Cannot get just the text of an option from submitted data I'm using Webform 8.x-5.8.
I've got a select box referencing some content. Of course, the numeric option value is passed. But when I reference submitted data with tokens, I just want to handle the plain text appearing with the options, but a concatenation of the text and the sequence &quot; (NID)&quot; is displayed instead, where NID is the content ID. An example with dummy code, names and values - just to roughly show what I suppose is happening behind - is following.
&lt;select name=&quot;my_parameter&quot;&gt;
&lt;option value=&quot;80&quot; selected&gt;Some text&lt;/option&gt;
...
...
...
&lt;/select&gt;

By selecting Some text, &quot;80&quot; is passed.
My aim is displaying &quot;Some text&quot; picking it up from the submitted values.
Tried with [webform_submission:values:my_parameter] and [webform_submission:values:my_parameter:value].
Anyway I get Some text (80).
What am I supposed to do in order to get rid of that final NID in brackets?
Thanks in advance!
Andrea
I scanned Webform's code base for [webform_submission:values: and eventually found the webform.token.inc file to list a number of Webform tokens from submission values. One of them being entity:*. And another being delta.
'&lt;li&gt;element_key:entity:*&lt;/li&gt;' .
'&lt;li&gt;element_key:delta:entity:*&lt;/li&gt;'


The 'entity:*' applies to the referenced entity
The 'delta' is the numeric index for specific value

And when I scan Drupal core's code base for :entity:title] there's [comment:entity:title]. When I scan for just :title] there's [node:title] among the first hits. Okay, with all that I'd assume it must work with either:
[webform_submission:values:ELEMENT_KEY:entity:title]

Or if it's a multi-value field try it with a :delta of 0 to ensure you only get the first referenced node's title.
[webform_submission:values:ELEMENT_KEY:0:entity:title]


Just found out for taxonomy terms it's :name at the end:
[webform_submission:values:ELEMENT_KEY:entity:name]