This is probably a duplicate but I can't find exactly what's happening here.

In the email to be sent to the user I am unable to make submitted values appear in the text. All I want it to say is something like "Dear Dr. Smith".

I have tried this:
Dear %email[name_title] %email[last_name],

and I have tried this:
Dear %value[name_title] %value[last_name],

and the token itself prints. Both fields are selected in the list of included email values. I can't figure out what I'm doing wrong.

Any suggestions? Many thanks. This is on the whole a great module. Just this one little thing . . .

Comments

quicksketch’s picture

Looks like this would work. Are your fields for "name_title" and "last_name" under a fieldset or just in the root of the form? Are you sure that the "Field key" for each of these fields is correct?

mollyavalon’s picture

Oh, now, see, I am a nitwit.

Thank you so much, quicksketch! My fields ARE in a fieldset, and that is explained right on the email page.

I knew it was user error.

quicksketch’s picture

Status: Active » Fixed

Sweet, great. For other users finding this thread, any fields under a fieldset are referenced by %value[fieldset_name][field_name].

Status: Fixed » Closed (fixed)

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

MadMich’s picture

I have followed your lead here and added %value[fieldset_name][field_name].

When no text is added to the value field i expected it not to display. Instead of which it displays the '[field_name]' line. Is there anyway of stopping this?

avantwaves’s picture

Same problem here.
I am using %value[fieldset_key][field_key] for some fields and %email[fieldset_key][field_key] and all I get is the token printed in the email like:

*User Information:*
[your_email_address]
[your_age]

Instead of:

*User Information:*
Email: someone@emailexample.com
Age: 24

quicksketch’s picture

Version: 6.x-3.11 » 6.x-3.14
Status: Closed (fixed) » Active

I'm having trouble understanding what the input, actual result, and expected result are in these reports. Could you clarify what your exact template code is, where the field is located in your form, and what the result is (with the field blank and with the field filled out).

avantwaves’s picture

These are the fields in the form.

User Information <- Fieldset with key user_information
Name <- key user_name
Email <- key user_email
Age <- key user_age

This is the template.

Submitted on: %date

User Information:
%email[user_information][user_name]
%email[user_information][user_email]
%email[user_information][user_age]

The strange thing is that %date is being printed correctly. The output that I am getting is:

Submitted on: Monday, October 24, 2011 - 12:55

User Information:
[user_name]
[user_email]
[user_age]

quicksketch’s picture

Excellent, thanks that's a very helpful report. So you're getting the last part of the token no matter what, whether the field is filled out or empty, right?

avantwaves’s picture

Yes, that is correct. I am getting the last part of the token no matter what.
Also if I move the field outside the fieldset and use %email[user_email] the field prints just fine.

avantwaves’s picture

Well now this is strange... all of the sudden all is working just fine. :O I don't know why... cause I didn't change anything... Weird

quicksketch’s picture

Status: Active » Closed (duplicate)

Let's track this issue in #1332820: Parts of nested tokens (in fieldsets) printed when left empty. It looks like the same report but got to the point more quickly.

sgwood’s picture

Please note that the token system has now changed in D7
i.e.
Token System Replaced with D7-style Tokens
http://drupal.org/node/1609324

So instead of %value[$key]
it should be now
[submission:values:$key:nolabel]

e.g.
[submission:values:first_name:nolabel]
returns:
Sally

or

[submission:values:first_name]
returns:
First Name: Sally

I was attempting to use the %value[$key]
where only %value[$key] was returned
i.e. it was not parsed.

davidhofmann’s picture

Issue summary: View changes

Question, with the new format, how do you access the values under a field set?

I have a field key, award_recommendation, and a text field under it, persons_name. I'd like to set the webform subject to Award Recommendation: (Persons Name)

For Example:

Award Recommendation: Bob Rider

DanChadwick’s picture

Drupal 7: [submission:values:YOUR_FIELD_SET_FORM_KEY:YOUR_NESTED_FIELD_SET_FORM_KEY:YOUR_TEXt_FIELD_FORM_KEY]
Drupal 6: no clue.

If this isn't in the webform documentation, please add it. Also it's best to open a new issue, rather than post to a 3 year old issue.

dcanetma’s picture

Thanks @danchadwick

That worked for me on version 7.

Example would be:

[submission:values:datos_de_la_empresa:nombre_de_la_empresa:withlabel]

Where

* datos_de_la_empresa - machine fieldset name
* nombre_de_la_empresa - machine field name
* withlabel - value modifier

The output looks like this:

nombre_de_la_empresa field label: nombre_de_la_empresa field value

Thanks.

D.

Parvateesam’s picture

Hi,

I'm also having same issue "Webform token values not appearing in email text" ,I have tried above all things but i'm getting empty submission values.I'm using below default thing only

Submitted on [submission:date:long]

Submitted by user: [submission:user]

Submitted values are:

[submission:values]

The results of this submission may be viewed at:

[submission:url]

below information getting in my mail text

Submitted on
Submitted by anonymous user:
Submitted values are:

The results of this submission may be viewed at:

Please help me.

Thanks,

DanChadwick’s picture

This is a Drupal 6 issue. Those tokens don't work in Drupal 6. If you aren't using Drupal 6, open a new issue with exactly what your components are (including their field keys) and what tokens you are using.

Parvateesam’s picture

Hi
DanChadwick,

Thanks for your response. I'm working drupal 7 environment. below info is default thing but i'm getting empty results

Submitted on [submission:date:long]

Submitted by user: [submission:user]

Submitted values are:

[submission:values]

The results of this submission may be viewed at:

[submission:url]

Below information getting in my mail text

Submitted on
Submitted by anonymous user:
Submitted values are:

The results of this submission may be viewed at:

My components and field keys are :

Legal First Name -> key legal_first_name
Middle Name -> key middle_name
Legal Last Name -> key legal_last_name
Prefix -> key prefix
Preferred Name -> key preferred
Address Line 1 -> key address_line_1

I have follow below format also for getting submission values in my mail text.

[submission:values:legal_first_name:nolabel]
[submission:values:middle_name:nolabel]
[submission:values:legal_last_name:nolabel]
[submission:values:prefix:nolabel]
[submission:values:preferred:nolabel]
[submission:values:address_line_1:nolabel]

Thanks,

DanChadwick’s picture

Open a new issue.

Parvateesam’s picture

Hi,
DanChadwick,

Issue is resolved i have disabled all dependent modules and disabled token module then again re enabled all modules now working fine.

one more doubt how can i align these key fields and labels with good css design ? below are the my key fields ,i need to display this values in my mail text with good view either tables format or div's

[submission:values:legal_first_name:withlabel]
[submission:values:middle_name:withlabel]
[submission:values:legal_last_name:withlabel]

Please suggest me.

Thanks,
Parvateesam.