How to test the existence of a file in a webform email twig template I have a webform with a Document File field. In my twig email template, I want to test if that field is empty. For text area fields for example, this syntax works :

{% if webform_token('[webform_submission:values:question_text_area:value]', webform_submission) %}
 &lt;br&gt;
 &lt;table&gt;
  &lt;tr&gt;
  &lt;th&gt;Questions&lt;/th&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;{{ webform_token('[webform_submission:values:question_text_area:value]', webform_submission) }}&lt;/td&gt;
  &lt;/tr&gt;
 &lt;/table&gt;
 {% endif %}

But for a Document File field, the same syntax does not work, meaning that if no file is uploaded, that part of my template is still printed.

I tried 

{% if webform_token('[webform_submission:values:join_a_file:value]', webform_submission) %}

or 

{% if webform_token('[webform_submission:values:join_a_file:value]', webform_submission) is not null %}

or 

{% if webform_token('[webform_submission:values:join_a_file]', webform_submission) is not null %}

and none of them work.

Does anybody know the proper syntax for what I'm trying to do? Thanks!
The solution is to do this

{% if webform_token('[webform_submission:values:file:clear]', webform_submission) %}
  FILE UPLOADED
{% else %}
  NO FILE UPLOADED
{% endif %}

Solution given first here : https://www.drupal.org/project/webform/issues/2969437