I have my webform "Testing" with some field element(field1, field2, etc…) and "person" that is entity reference element(entity automplete) that reference user.
So, I create may custom file entity-print-submission–testing.html.twig file for theming PDF.
With this {{ data.field1 }} {{ data.field2 }}
i can render the value for that field, but this {{ data.person }}
render the ID of user select in webform.
I want to render field surname that is present in user profile. I have try to use {{ data.person.entity.field_surname }}
but return empty value.
In submission display option for person element I set custom and put this token in Item format custom HTML and Item format custom TEXT:
{{ webform_token('[webform_submission:values:person:entity:field_surname]', webform_submission) }}
This work only in submission display. It’s not render in my custom entity print twig file.