Webform Issue with Drop Down and Key not Equaling Value I have written a custom handler in Drupal 8 D8 that grabs submitted data from a webform and reformats it and sends it to a JSON webservice. That is all working perfectly. My issue is that the submitted data from 2 of the dropdowns is an integer (the key of the dropdown), rather than the value of the drop down, like it was when in D7 I called:

$components = $node-&gt;webform['components'];


which gave me the value of the data from the dropdowns. Now I am calling:

$values = $webform_submission-&gt;getData();


Which gives me the submission data. However, what I need to do is translate the number to the value. For example:

for a component (or element) drop down called 'numbers' the options are:
1|One
2|Two
3|Three

When I grab the submission data I get "1" but I want to send the word "One".

How do I load the dropdown element to translate the value '1' to the word "One" in Drupal 8?

Thanks.
When I grab the submission data I get "1"


This is standard in Drupal for select &amp; radio fields, you always get the key. 

So all we have to do is use the key to retrieve the value. 

$key = $webform_submission-&gt;getData()['field_select'];

// retrieve webform fields.
$webform_fields = $webform_submission-&gt;getWebform()-&gt;getElementsDecoded();

// use key to retrieve value of field_select.
$value = $webform_fields['field_select']['#options'][$key];