1

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, etc...

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 set the same list in the webform.

In the Rules Action "Create a new entity" the Rules 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?

0

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!).
  • Thank you for your reply but if you read better my question I still use the webform fields to populate entity values, my problem is on list fields that I can't set with my custom default value... – SmurfXXX Jan 19 '17 at 7:50
  • The question is simple: how to set the value of "Region" that is a TEXT LIST, I repeat, a TEXT LIST field. I can set what I want to TEXT fields but not with TEXT LIST fileds. – SmurfXXX Jan 19 '17 at 8:25
  • Please, read everything I wrote, I don't need a loop to create a single entity user from a webform submission. I invite you to read WELL what I wrote... – SmurfXXX Jan 19 '17 at 8:33
  • @SmurfXXX can you try with the technique I described in my updated answer? – Pierre.Vriens Dec 1 '17 at 13:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.