Given the following element in my webform, how do I print Name: Fred in my email?

Title   Key   Value
Name    name  Fred

I understand how to print the raw value. How do I print the title?

[?]: [webform_submission:values:name:raw]

An admin may change the element's title, so I can't have Name: [webform_submission:values:name:raw].

2 Answers 2


Accessing a webform's element properties including #title, #description via tokens is not currently supported. I am not sure the core Webform module should provide these tokens, but a third-party module can easily make these tokens available.

  • Yes, for Drupal 8.
    – dbj44
    Commented Oct 4, 2017 at 14:13

You can now use a Twig template. I have an if statement so that the label and colon are omitted if the element is left empty.

{% if data.name %}
  {{ elements.name['#title'] }}: {{ data.name }}
{% endif %}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.