Closed (fixed)
Project:
Webform Rules
Version:
7.x-1.4
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
8 Aug 2012 at 16:39 UTC
Updated:
24 Jan 2018 at 14:31 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
stborchertIf you're using "Execute custom PHP code" as Rules action you can display the complete submission array with
<?php dpm($data); ?>(implied you've installed Devel).For more information look at the README.txt or the other issues (e.g. #1363868-11: How to create a webform condition on a submitted value in a specific webform field?).
Comment #2
mrpauldriver commentedThank you stBorchert, but alas, straight over my head.
Maybe my time has arrived to start learning some php - I knew this day would come sooner or later !
I don't suppose there is an easier way?
Comment #3
stborchertAs you can read in the README.txt of Wenform Rules and can see on the rules configuration pages the submitted values are available as tokens also.
Comment #4
mrpauldriver commentedThank you. I'll take a peep.
Comment #5
stborchertComment #6
mrpauldriver commentedI wish it was fixed :-) Still struggling to understand really.
I get the token bit, but don't get how to specify which token and how to pass the values.
Comment #7
stborchertDo you see the fieldset "Replacement patterns" within the configuration screen of your rule?

Expand this and you'll see something like this:
To use the value of a component named "name" simply use the token
[data:name-value].Comment #8
chris_h commentedFor the non-PHPers here, would you be able to give an example of how to pass the value from [data:name-value] as a condition, where the value submitted for that is "yes", for example?
Comment #9
chris_h commentedOK, I think I solved it. Based on http://drupal.org/node/1627800#comment-6141152, this allowed me to set a condition based on a select list value.
Comment #10
stborchertYou can simplify this to a one-liner:
This will check if the field has been submitted and has the specified value.
Comment #12
tsmulugeta commentedHi,
I have this: $data['components']['field_name']['value'][0];
But how would I rewrite this if the field "'field_name" is within a fieldset?
Comment #13
kyleheney commentedHi,
I have a question about this too. I currently have a rule that creates a new user account (creates an entity), but I'd also like to set the Profile values for this new user (I am using the Profile module to add fields to my users' profiles, namely employee name, department, etc.).
My field for the employee name in the Profile module is "profile_name" and my field for collecting the employee name in my webform is "employee_name".
How would I go about assigning this new entity a "profile_name" based on the webform data field "employee_name"?
Thanks for any help.
Comment #14
Pierre.Vriens commentedThis seems like a variation of the question about "How to do a data comparison to submitted webform data when using the Rules module?". Refer to my answer to it for a solution to get this to work.
PS: no need for any type of PHP coding (or the dangerous PHP filter to be enabled ...)