I am trying to write a condition in which I have to select a 'form_step' (text). I am passing a list (all the steps in the form) to the event, but if I try to access this list (all-steps) through the data-selector, I just see the list with 4 items, numbered 1 to 4, which is kind of impossible because there are only 2 items in my steps list.. (checked with dsm/devel)

anybody who could help me with this / any ideas?

Comments

TR’s picture

Issue summary: View changes
Status: Active » Fixed

Rules cannot know how many values are actually in the list until your rule executes - one list can have 1 value, another list can have three values, etc. Tokens are generated for the list as a whole, and individually for the first four values as a convenience. Most processing of lists will have to be done in a loop because elements in a list are not sorted or stored in any particular order and there is no "key" you can use to access individual items.

If you want to test all the elements in a list, you need to loop over the elements of the list. There is some documentation with examples at
https://www.drupal.org/node/1803938, and I was also able to find some with a google search, so I'm not going to go into detail about how to set up a loop here unless you have some specific questions.

TR’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.