Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). Varbase Media Header 9.2.1 Minor update available for module varbase_media_header (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

This module enhances the Rules module by allowing you to use tokens from various token-providing modules within your rules. It offers an action to retrieve token values and conditions to compare data with tokens or compare two tokens, providing access to site information, entity data, and more.

This module extends the 'Rules' module for Drupal >=9.
The module enables to use in Rules tokens provided by the following modules:
'Token'
'Custom Tokens'
'Custom Tokens Plus'
'Advanced Entity Tokens'

It allows getting values of any Drupal data and use them in Rules.
You can get the current date, site URL, webform submissions and so on.

Uses

The module provides one action, named 'Get token value'.
And it provides two conditions, named 'Compare Data with Token' and 'Compare Token with Token'.
They are easy to use.
You just need to remember that there are two types of tokens:

  1. Tokens that related with a context of a current rule event.
    The examples of such tokens are:
      [node:],
      [user:],
      [webform_submission:]

    For such tokens you need to specify the entity to which they are intended.
    The field named 'ENTITY OF TOKEN' provided for that.
    You have to switch to the 'Data selection mode'
    (click on the 'Switch to data selection' button).
    And then select the relevant entity using the selector.
  2. Global tokens that not related with a context.
    The examples of such tokens are:
      [date:],
      [url:],
      [random:]

    For those tokens you don't have to specify any entity.
    Therefore, you should leave the 'ENTITY OF TOKEN' field empty.

'Get token value' action

Let's say you want to get the value of a webform field after a webform submitted.
For instance, the name of the webform is 'Contact' and the name of the field is 'Message'.
To achieve the goal to do the following:

  1. Install the 'Webform' module.
  2. Create the new rule to react on 'After saving a new webform submission' event.
    You will find it under 'Webform submission' section of the event list.
    (be warned, that the 'Rules Webform' module can hide this event).
  3. Add the 'Get token value' action
    (you will find it under the 'Data' section of the action list).
  4. Click inside the 'TOKEN' field to specify the place for the token insertion.
  5. Then click on the 'Browse available tokens.' link
    (you will find it under the 'TOKEN' field).
  6. Wait to see the window with the available tokens list.
    Find the [webform_submission:values:?] token from the appeared window.
  7. Click on this token.
    After that, this token will be inserted into the 'TOKEN' field.
  8. Replace the question mark in the token with the webform field key.
    As a result our token will change to: [webform_submission:values:message]
  9. Type the token entity into the 'ENTITY OF TOKEN' field.
    To do this click on the 'Switch to data selection' button
    (you will find it under the 'ENTITY OF TOKEN' field).
    Then select the 'webform_submission' variable from the selector.
    After that the 'ENTITY OF TOKEN' field will contain the following value:
    webform_submission
  10. Click on the 'Save' button and save the rule.

After that, the new 'token_value' variable will be accessible in the data selector.
When the rule run, this variable will contain the value of our token.
And you are free to use it in others actions of the rule.

If you need to get the current date or site URL, then select the tokens,
for instance, [date:html_date] and [site:url-brief]
and leave the 'ENTITY OF TOKEN' field empty.

'Compare Data with Token' condition

For example, you want to compare the current date with a some value.
For that you should to do the following:

  1. Add the 'Compare Data with Token' condition
    (you will find it under the 'Data' section of the condition list).
  2. Input the value to be compared into 'Data' field.
  3. Click on the 'Browse available tokens.' link
    (the link is located under the 'TOKEN' field).
  4. Select the appropriate token, for instance, [date:html_date]
  5. Because we used the global token, leave the 'ENTITY OF TOKEN' field empty.
  6. Click on the 'Save' button.

'Compare Token with Token' condition

Use this condition if you need to compare the values of two tokens.

Activity

Total releases
1
First release
Jul 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Dormant

Releases

Version Type Release date
2.0.2 Stable Jul 8, 2025