Provides Views directly as Rules actions and loops to seamlessly use view result data.

This module provides a "Rules" display in Views. The display allows configuration of Views contextual filters and fields as Rules parameters and row variables. Settings for each parameter or variable include: type, label, name.

This module also provides two types of elements in Rules, configured with a "Rules" view display:

View loop
A view loop is similar to a regular Rules loop, but allows looping over rows of view results.
Collect view result rows (action):
This action collects each variable in all view result rows into list variables for use in Rules.

How to use?

  1. Install the module (and make sure Rules UI and Views UI are both enabled)
  2. Configured Views
    1. Add a view (with some fields)
    2. Add a "Rules" display
    3. Configure row variables
    4. Save
  3. Configure Rules
    1. Add a rule
    2. Add the "Collect view result rows" action or add a view loop
    3. Select the "Rules" display
    4. Configure the parameters and variable names
    5. [Do what you want with the newly available variables]

Quick tip

When selecting the data type for variables in the view, if the field is an entity
identifier (e.g. Node ID), you can set the data type to the entity type (i.e. Node) to directly use the variable in Rules as an entity!

Common issues

#1777516: Doesn't seem to work on cron run

Difference from Views Bulk Operations

Views Bulk Operations (VBO) allows a rule to execute a view and vice versa. Views Rules makes Views data available in Rules, enabling intuitive rule configuration for dynamic data.

Sponsor

Development of this module is supported by PhpStorm Open Source license from JetBrains.

Project Information

Downloads