How to pass the Body field from a View to Rules? Context: using the Views Rules module to pass a number of items to an action-loop in a Rules component (Action Set).

In views (display: rules) I selected among others the Body-field to be used. This field appears to be an array of different things (value, summary, format), when I use the [body-from-view:value] in an action, it seems to be empty. 

Question
I must have some settings wrong. What Data Type do I have to select in the Row Variables (Rules Settings) in the View for the Body-field? Or maybe I use a wrong Replacement Pattern in the Action?

Note: handling nid, email, title, date works very well, these have Data type like text, integer, date.
I assume you performed the steps similar to what is documented in my answer to "How to send out email based on matching taxonomy terms in user profiles?". And while doing so, you probably used a field name like body-from-view in the "Rules" display of your view. I'm not sure if it is the only way to get it to work, but below is a possible solution to answer your question ...

Part 1 - Getting it to work

Define the body field 3 times in your view

When adding the "body" as a field in your view, add that field 3 times. And when configuring these Views fields, make sure to use these field formatters:


Default (for the 1st "body" field).
Trimmed (for the 2nd "body" field).
Summary or trimmed (for the 3rd "body" field).


Select the 3 body fields 3 times in your view

When you edit the Rules settings of your view (by using the link that says "edit field info"), use 3 separate variables for each of the 3 body fields, e.g using machine names that look something like so:


body-default
body-trimmed
body-summary-or-trimmed


I'm not sure (yet) about the most appropriate "data type" to use for these 3 variables, but in my case I just used "text".

Create your Rules Component using appropriate tokens


Within the Rules Actions of your Rules Component, use the link that says Add view loop to add a Views loop, and select the "Rules" display created in the previous step.
Within that Views loop add whatever Rules Action that fits your needs. E.g. to get started, just perform "Show a message on the site". At that point, you should have access to these token values that you're looking for (if you use the same machine names as suggested above):
[body-default:value]
[body-trimmed:value]
[body-summary-or-trimmed:value]


Part 2 - Showtime

Here is an example of the execution of a rules component, in which I implemented what's mentioned in "Part 1", using a Rules Action to show a message on the site, and which looks like so:

&lt;hr /&gt;
Details about node with id = [node-nid:value] and title = [node-title:value]:&lt;br /&gt;&lt;br /&gt;
- &lt;strong&gt;body-summary-or-trimmed&lt;/strong&gt; = [body-summary-or-trimmed:value]&lt;br /&gt;
- &lt;strong&gt;body-trimmed&lt;/strong&gt; = [body-trimmed:value]&lt;br /&gt;
- &lt;strong&gt;body-default&lt;/strong&gt; = [body-default:value]&lt;br /&gt;
&lt;br /&gt;&lt;hr /&gt;


After executing it, and with 3 nodes that were included in my Views result, the result looks like so:

Details about node with id = 163 and title = Node with summary and separator line:

- body-summary-or-trimmed = &lt;p&gt;This is the summary of this node ... and there is really nothing else after this (in this summary) ...&lt;/p&gt;
- body-trimmed = &lt;p&gt;This is the body of this node, which &lt;strong&gt;does have a summary also&lt;/strong&gt; ...&lt;/p&gt; &lt;p&gt;It has multiple lines, and the separator line is inserted right here ...&lt;/p&gt;
- body-default = &lt;p&gt;This is the body of this node, which &lt;strong&gt;does have a summary also&lt;/strong&gt; ...&lt;/p&gt; &lt;p&gt;It has multiple lines, and the separator line is inserted right here ...&lt;/p&gt; &lt;p&gt;And from here on there is even more content (after the separator line ...)&lt;/p&gt; &lt;p&gt;Some more lines (1).&lt;/p&gt; &lt;p&gt;Some more lines (2).&lt;/p&gt; &lt;p&gt;Some more lines (3).&lt;/p&gt; &lt;p&gt;Some more lines (4).&lt;/p&gt;

Details about node with id = 162 and title = Node without a summary but with a separator line:

- body-summary-or-trimmed = &lt;p&gt;This is the body of a node which &lt;strong&gt;does not have a summary&lt;/strong&gt; ...&lt;/p&gt; &lt;p&gt;It has multiple lines, and the separator line is inserted right here ...&lt;/p&gt;
- body-trimmed = &lt;p&gt;This is the body of a node which &lt;strong&gt;does not have a summary&lt;/strong&gt; ...&lt;/p&gt; &lt;p&gt;It has multiple lines, and the separator line is inserted right here ...&lt;/p&gt;
- body-default = &lt;p&gt;This is the body of a node which &lt;strong&gt;does not have a summary&lt;/strong&gt; ...&lt;/p&gt; &lt;p&gt;It has multiple lines, and the separator line is inserted right here ...&lt;/p&gt; &lt;p&gt;And from here on there is even more content (after the separator line ...)&lt;/p&gt; &lt;p&gt;Some more lines (1).&lt;/p&gt; &lt;p&gt;Some more lines (2).&lt;/p&gt; &lt;p&gt;Some more lines (3).&lt;/p&gt; &lt;p&gt;Some more lines (4).&lt;/p&gt;

Details about node with id = 161 and title = Node without a summary and without a separator line :

- body-summary-or-trimmed = &lt;p&gt;This is the body of this node, which &lt;strong&gt;does NOT have a summary&lt;/strong&gt; ...&lt;/p&gt; &lt;p&gt;It has multiple lines, &lt;strong&gt;but no separator line&lt;/strong&gt;  ...&lt;/p&gt;
- body-trimmed = &lt;p&gt;This is the body of this node, which &lt;strong&gt;does NOT have a summary&lt;/strong&gt; ...&lt;/p&gt; &lt;p&gt;It has multiple lines, &lt;strong&gt;but no separator line&lt;/strong&gt;  ...&lt;/p&gt;
- body-default = &lt;p&gt;This is the body of this node, which &lt;strong&gt;does NOT have a summary&lt;/strong&gt; ...&lt;/p&gt; &lt;p&gt;It has multiple lines, &lt;strong&gt;but no separator line&lt;/strong&gt;  ...&lt;/p&gt; &lt;p&gt;And there is even more content ...&lt;/p&gt; &lt;p&gt;Some more lines (1).&lt;/p&gt; &lt;p&gt;Some more lines (2).&lt;/p&gt; &lt;p&gt;Some more lines (3).&lt;/p&gt; &lt;p&gt;Some more lines (4).&lt;/p&gt;

Component rule: Views Rules demonstration has been executed.


Part 3 - Pieces of the puzzle

Exported View

Here is an export of the view I created (use the Views UI to import it in your own site, adapt the filter criteria to fit your needs):

$view = new view();
$view-&gt;name = 'details_about_nodes';
$view-&gt;description = '';
$view-&gt;tag = 'default';
$view-&gt;base_table = 'node';
$view-&gt;human_name = 'Details about nodes';
$view-&gt;core = 7;
$view-&gt;api_version = '3.0';
$view-&gt;disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Master */
$handler = $view-&gt;new_display('default', 'Master', 'default');
$handler-&gt;display-&gt;display_options['title'] = 'Details about nodes';
$handler-&gt;display-&gt;display_options['use_more_always'] = FALSE;
$handler-&gt;display-&gt;display_options['access']['type'] = 'perm';
$handler-&gt;display-&gt;display_options['cache']['type'] = 'none';
$handler-&gt;display-&gt;display_options['query']['type'] = 'views_query';
$handler-&gt;display-&gt;display_options['exposed_form']['type'] = 'basic';
$handler-&gt;display-&gt;display_options['pager']['type'] = 'full';
$handler-&gt;display-&gt;display_options['pager']['options']['items_per_page'] = '10';
$handler-&gt;display-&gt;display_options['style_plugin'] = 'table';
$handler-&gt;display-&gt;display_options['style_options']['columns'] = array(
  'title' =&gt; 'title',
);
$handler-&gt;display-&gt;display_options['style_options']['default'] = '-1';
$handler-&gt;display-&gt;display_options['style_options']['info'] = array(
  'title' =&gt; array(
    'sortable' =&gt; 0,
    'default_sort_order' =&gt; 'asc',
    'align' =&gt; '',
    'separator' =&gt; '',
    'empty_column' =&gt; 0,
  ),
);
/* Field: Content: Title */
$handler-&gt;display-&gt;display_options['fields']['title']['id'] = 'title';
$handler-&gt;display-&gt;display_options['fields']['title']['table'] = 'node';
$handler-&gt;display-&gt;display_options['fields']['title']['field'] = 'title';
$handler-&gt;display-&gt;display_options['fields']['title']['label'] = '';
$handler-&gt;display-&gt;display_options['fields']['title']['alter']['word_boundary'] = FALSE;
$handler-&gt;display-&gt;display_options['fields']['title']['alter']['ellipsis'] = FALSE;
/* Field: Content: Nid */
$handler-&gt;display-&gt;display_options['fields']['nid']['id'] = 'nid';
$handler-&gt;display-&gt;display_options['fields']['nid']['table'] = 'node';
$handler-&gt;display-&gt;display_options['fields']['nid']['field'] = 'nid';
/* Field: Content: Body */
$handler-&gt;display-&gt;display_options['fields']['body_1']['id'] = 'body_1';
$handler-&gt;display-&gt;display_options['fields']['body_1']['table'] = 'field_data_body';
$handler-&gt;display-&gt;display_options['fields']['body_1']['field'] = 'body';
$handler-&gt;display-&gt;display_options['fields']['body_1']['label'] = 'Body - Summary or trimmed';
$handler-&gt;display-&gt;display_options['fields']['body_1']['type'] = 'text_summary_or_trimmed';
$handler-&gt;display-&gt;display_options['fields']['body_1']['settings'] = array(
  'trim_length' =&gt; '200',
);
/* Field: Content: Body */
$handler-&gt;display-&gt;display_options['fields']['body_2']['id'] = 'body_2';
$handler-&gt;display-&gt;display_options['fields']['body_2']['table'] = 'field_data_body';
$handler-&gt;display-&gt;display_options['fields']['body_2']['field'] = 'body';
$handler-&gt;display-&gt;display_options['fields']['body_2']['label'] = 'Body - Trimmed';
$handler-&gt;display-&gt;display_options['fields']['body_2']['type'] = 'text_trimmed';
$handler-&gt;display-&gt;display_options['fields']['body_2']['settings'] = array(
  'trim_length' =&gt; '200',
);
/* Field: Content: Body */
$handler-&gt;display-&gt;display_options['fields']['body']['id'] = 'body';
$handler-&gt;display-&gt;display_options['fields']['body']['table'] = 'field_data_body';
$handler-&gt;display-&gt;display_options['fields']['body']['field'] = 'body';
$handler-&gt;display-&gt;display_options['fields']['body']['label'] = 'Body - Default';
/* Sort criterion: Content: Post date */
$handler-&gt;display-&gt;display_options['sorts']['created']['id'] = 'created';
$handler-&gt;display-&gt;display_options['sorts']['created']['table'] = 'node';
$handler-&gt;display-&gt;display_options['sorts']['created']['field'] = 'created';
$handler-&gt;display-&gt;display_options['sorts']['created']['order'] = 'DESC';
/* Filter criterion: Content: Published */
$handler-&gt;display-&gt;display_options['filters']['status']['id'] = 'status';
$handler-&gt;display-&gt;display_options['filters']['status']['table'] = 'node';
$handler-&gt;display-&gt;display_options['filters']['status']['field'] = 'status';
$handler-&gt;display-&gt;display_options['filters']['status']['value'] = 1;
$handler-&gt;display-&gt;display_options['filters']['status']['group'] = 1;
$handler-&gt;display-&gt;display_options['filters']['status']['expose']['operator'] = FALSE;
/* Filter criterion: Content: Type */
$handler-&gt;display-&gt;display_options['filters']['type']['id'] = 'type';
$handler-&gt;display-&gt;display_options['filters']['type']['table'] = 'node';
$handler-&gt;display-&gt;display_options['filters']['type']['field'] = 'type';
$handler-&gt;display-&gt;display_options['filters']['type']['value'] = array(
  'page' =&gt; 'page',
);
/* Filter criterion: Content: Nid */
$handler-&gt;display-&gt;display_options['filters']['nid']['id'] = 'nid';
$handler-&gt;display-&gt;display_options['filters']['nid']['table'] = 'node';
$handler-&gt;display-&gt;display_options['filters']['nid']['field'] = 'nid';
$handler-&gt;display-&gt;display_options['filters']['nid']['operator'] = '&gt;';
$handler-&gt;display-&gt;display_options['filters']['nid']['value']['value'] = '10';

/* Display: Page */
$handler = $view-&gt;new_display('page', 'Page', 'page');
$handler-&gt;display-&gt;display_options['path'] = 'details-about-nodes';

/* Display: ListToCreateRulesLoop */
$handler = $view-&gt;new_display('views_rules', 'ListToCreateRulesLoop', 'views_rules_1');
$handler-&gt;display-&gt;display_options['pager']['type'] = 'some';
$handler-&gt;display-&gt;display_options['rules_variables'] = array(
  'title' =&gt; array(
    'enabled' =&gt; 1,
    'rendered' =&gt; 0,
    'type' =&gt; 'text',
    'label' =&gt; 'Content: Title',
    'name' =&gt; 'node_title',
  ),
  'nid' =&gt; array(
    'enabled' =&gt; 1,
    'rendered' =&gt; 0,
    'type' =&gt; 'integer',
    'label' =&gt; 'Nid',
    'name' =&gt; 'node_nid',
  ),
  'body_1' =&gt; array(
    'enabled' =&gt; 1,
    'rendered' =&gt; 1,
    'type' =&gt; 'text',
    'label' =&gt; 'Body - Summary or trimmed',
    'name' =&gt; 'body_summary_or_trimmed',
  ),
  'body_2' =&gt; array(
    'enabled' =&gt; 1,
    'rendered' =&gt; 1,
    'type' =&gt; 'text',
    'label' =&gt; 'Body - Trimmed',
    'name' =&gt; 'body_trimmed',
  ),
  'body' =&gt; array(
    'enabled' =&gt; 1,
    'rendered' =&gt; 1,
    'type' =&gt; 'text',
    'label' =&gt; 'Body - Default',
    'name' =&gt; 'body_default',
  ),
);


Exported Rules Component

Here is an export of the Rules Component I created (use the Rules UI to import it in your own site, adapt the Rules Conditions to fit your needs):

{ "rules_views_rules_demonstration" : {
    "LABEL" : "Views Rules demonstration",
    "PLUGIN" : "rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules" ],
    "IF" : [
      { "user_has_role" : {
          "account" : [ "site:current-user" ],
          "roles" : { "value" : { "3" : "3" } }
        }
      }
    ],
    "DO" : [
      { "VIEW LOOP" : {
          "VIEW" : "details_about_nodes",
          "DISPLAY" : "views_rules_1",
          "ROW VARIABLES" : {
            "node_title" : { "node_title" : "Content: Title" },
            "node_nid" : { "node_nid" : "Nid" },
            "body_summary_or_trimmed" : { "body_summary_or_trimmed" : "Body - Summary or trimmed" },
            "body_trimmed" : { "body_trimmed" : "Body - Trimmed" },
            "body_default" : { "body_default" : "Body - Default" }
          },
          "DO" : [
            { "drupal_message" : { "message" : "\u003Chr \/\u003E\r\nDetails about node with id = [node-nid:value] and title = [node-title:value]:\u003Cbr \/\u003E\u003Cbr \/\u003E\r\n- \u003Cstrong\u003Ebody-summary-or-trimmed\u003C\/strong\u003E = [body-summary-or-trimmed:value]\u003Cbr \/\u003E\r\n- \u003Cstrong\u003Ebody-trimmed\u003C\/strong\u003E = [body-trimmed:value]\u003Cbr \/\u003E\r\n- \u003Cstrong\u003Ebody-default\u003C\/strong\u003E = [body-default:value]\u003Cbr \/\u003E\r\n\u003Cbr \/\u003E\u003Chr \/\u003E" } }
          ]
        }
      }
    ]
  }
}