Are these tokens supposed to be available in the webform [submission:values] array?

I can call [submission:values:my_address_field] to print the formatted address, but I can't seem to reference any of the sub-tokens?

[submission:values:my_address_field:locality], [submission:values:my_address_field:postal-code], etc.

Comments

jeremdow created an issue. See original summary.

jeremdow’s picture

Does anyone know how to reference these tokens from the form submission - I feel like I must be missing something simple here?

vsalvans’s picture

HI, I've got the same issue. I've tried everything [submission:values:address:postal_code] [submission:values:address][postal_code] [submission:values:address:address_field:postal_code] , etc...

At the moment I've end up by creating a custom template in my theme called webform-mail-[nid].tpl.php and use this code for every address subfield:

<p>Adreça: <?php echo $submission->data[2][0]["thoroughfare"] ?></p>
<p>Adreça (extra): <?php echo $submission->data[2][0]["premise"] ?></p>
<p>Codi postal: <?php echo $submission->data[2][0]["postal_code"] ?></p>
<p>Municipi: <?php echo $submission->data[2][0]["locality"] ?></p>
etc...

Where index 2 after in "data" property means the second webform component (is indexed from 1). However I'd like to use addressfield tokens, as are so convinient instead of creating templates files.

daniel.imre’s picture

Does anyone know if it's possible to use these webform addressfield tokens in a view? The view provides a number of replacement patterns, but none of them are of use.
Screenshot: http://imgur.com/a/0p3Tm

lambic’s picture

StatusFileSize
new2.26 KB

Attached is a patch for this, it adds some extra text to the help text for webform submissions values tokens and parses individual addressfield tokens for webform submission components.

lambic’s picture

StatusFileSize
new2.57 KB

Updated the patch to make the help text a bit better.

  • markie committed 57b632a on 7.x-1.x authored by lambic
    Issue #2825562 by lambic: Reference tokens in webform [submission:values...
markie’s picture

Status: Active » Fixed

Added patch to 7.x-1.x branch. Additionally cleaned up the coding standards for that file. Thanks for your patience.

Status: Fixed » Closed (fixed)

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