The move to "proper tokens" in Webform 4.0 is fantastic and has really helped us get more out of e.g. webform emails. But I've found an ambiguity in the documentation for the "Webform submission values" tokens.

A client was trying to use the tokens of the format [submission:values:?:nolabel] and couldn't get them to work based on the documentation ("Replace the "?" with the "Field Key"). Neither could we.

It was only through looking at the code in webform.tokens.inc that we realised that you actually have to replace "?" with the field key of all containing fieldset parents, plus the element: so

[submission:values:your_details:first_name:nolabel]

instead of just

[submission:values:first_name:nolabel]

I appreciate why that's the case, but I don't think it's currently clear. So I'll attach a patch in my first comment, to just disambiguate this documentation. I don't want to start bikeshedding wording, but I think a small change would really help non-programmer users.

Comments

Here's the patch. It's quite small so should be straightforward to review!

Version:7.x-4.0-alpha3» 7.x-4.x-dev
StatusFileSize
new1.18 KB

I totally agree with jp stacey. However the patch in #1 didn't apply for me :
fatal: git diff header lacks filename information when removing 1 leading pathname components (line 5)

Re-rolled. Also made some small textual changes. And updated README.txt to point users toward the documentation.

Category:bug» task
Status:Needs review» Fixed

Thanks! I agree it needs help. I've changed the string to be this:

'Webform tokens from submitted data. Replace the "?" with the "field key", including any parent field keys separated by colons. Tokens include the field label and value. Append ":nolabel" for just the value.'

Thanks Quicksketch!

Yes, sorry, I missed quicksketch's reply last week. That'll do nicely.

Status:Fixed» Closed (fixed)

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