How can I tell to the rule I am writing that the value of region field is the value coming from webform data?

by SmurfXXX   Last Updated December 01, 2017 14:07 PM

I successfully created a webform using the webform module.

Using webform rules I can create a new entity of type user and I fill the requested fields using, for example, [data:name-value-raw] for name, [data:surname-value-raw] for surname ecc...

This is very easy for text fields but I have troubles with text list fields, in my custom user fields I have two text-list fields (region list and country list), I setted the same list in the webform.

In the action "Create a new entity" the UI tells me to set a value for these fields but I'm forced to choose from a value in the list.

enter image description here

If I switch to data selection I can't find submitted values, so how can I tell to the rule I am writing that the value of region field is the value coming from webform data?

Tags : rules webform


Answers 1


If I switch to data selection I can't find submitted values, so how can I tell to the rule I am writing that the value of region field is the value coming from webform data?

You can use a technique similar to what is described in my answer to "How to do a data comparison to submitted webform data when using the Rules module?". For short:

  • Add an extra Rules Action to Add a variable (call it whatever you want), with a value assigned to it equal to your [data:ComponentFieldName-value-raw] (with a data type which equals the data type of your Webform component), and with ComponentFieldName whatever you're using for that region field in your Webform).
  • In your subsequent Rules Actions you can refer to the value of this variable you just added (that's the clue!).
Pierre.Vriens
Pierre.Vriens
January 18, 2017 17:49 PM

Related Questions






Webform Data Comparison In Rules

Updated February 19, 2016 01:03 AM