The problem is: how to include values from a user's Profile2 fields as defaults for Webform 3 fields.
One solution, of course, is to upgrade to Webform 4. If you need to do this using Webform 3, however, you couldn't do it without "writing code."
Here's a workaround I haven't yet seen that involves no code writing:
- Assume our target is a Webform called "regform," and it has on it the usual suspects, like Company, Contact, Address, Phone, etc.
- Create a Basic Page and call it "pre-regform." Save it; no need to add anything to it.
- Whatever link you might have had pointing to "regform," have it point instead to "pre-regform."
- Create a Rule that does the following: "When a user views 'pre-regform,' redirect to 'regform/?company=[companytoken]&contact=[contacttoken]&city=[citytoken]' etc."
- On the "regform" webform, use the %get[company] syntax to populate your Company (and other) field.
Here's an example (my Profile2 profile name is "main"):
regform?company=[site:current-user:profile-main:field-company]&contact=[site:current-user:profile-main:field-full-name-]&address=[site:current-user:profile-main:field-address]&address2=[site:current-user:profile-main:field-address2-]&phone=[site:current-user:profile-main:field-phone]&city=[site:current-user:profile-main:field-city]&state=[site:current-user:profile-main:field-state-province]&zip=[site:current-user:profile-main:field-zip]&email=[site:current-user:mail]
Comments
Comment #1
stevengraff CreditAttribution: stevengraff commented