I’m using Webform in D9 and have a multipage form. In step 2 of the form, I need to show the taxonomy term that was selected in step 1.
I’ve defined the field that will display it as a computed twig field.
If I simply use
{{ data.my_field }}
I get back the tid.
If I instead put
{{ drupal_field('name', 'taxonomy_term', <tid> }}
I receive the desired text. However, I need the tid to come from the step 1 variable and not be a static string.
When I try
{{ drupal_field('name', 'taxonomy_term', data.my_field }}
I receive the error
Argument 3 passed to Twig Tweak Extension::drupal Field() must be of the type string, null given
which I then receive no matter what I try until I delete the field and re-add it. Is there any way in Webform (as opposed to in code) to do the equivalent of:
{% set tid = data.my_field %} {{ drupal.field('name', 'taxonomy_term', tid) }}