Submission token for select option value

Created on 2 August 2018, over 6 years ago
Updated 17 July 2024, 5 months ago

The current submission token [Webform_submission:values:?] when used for a select field returns the "option text". I need a way to return the "option value" in a token.
Example:
'#options':
10: Ten
20: Twenty
30: Thirty
40: Forty
50: Fifty

if the second item is selected to return the value "20" not "Twenty"

✨ Feature request
Status

Closed: works as designed

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States Drupal Duppy

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States fredonia_webteam

    #3 does solve the issue - when using the select type. If using autocomplete, it does not work. Only reason I can see is because the autocomplete requires textual input rather than selecting an option, it only sees the field as text, not as the options. I got around this issue by using the select Element settings Type with jQuery Select2.

  • πŸ‡ΊπŸ‡ΈUnited States uotonyh

    In case anyone else comes along this path*, the :raw suffix replaces the :key suffix from Drupal 7 Webform.

    Drupal 7: [submission:values:select_element:key]

    "Modern" Drupal: [webform_submission:values:select_element:raw]

    * Probably me, some time next year...

Production build 0.71.5 2024