I have quite a big E-Mail sent out by webforms. To display the Form, I use a lot of HTML / Markup fields. Mainly for Product descriptions and further informations relevant to the user by filling out the form. I use a Webform Table Element to display all of this stuff.

In the end it looks something like that:

col1       | col2  | col3    | col4
textfield1 | Text1 | Text1_2 | textfield1_2
textfield2 | Text2 | Text2_2 | textfield2_2
textfield3 | Text3 | Text3_2 | textfield3_2

Now, I need to send out an E-Mail and calculate the values and also print the values of the Text Elements.

My wish would be to use computed twig fields to assemble the line how I need it in the end.

{{ data.textfield1 }} x {{ Text1 }} - {{ Text1_2 }} = {{ data.textfield1 * data.textfield1_2 }}

Calculations and everything works well. I'm just not able to reuse the Text stored in a HTML Element. So my question is, how can I access this HTML / Text?

  • For such a complex custom element, I would recommend building a custom composite element in code. @see cgit.drupalcode.org/webform/tree/modules/… – jrockowitz Feb 2 '18 at 12:47
  • I did not find a way to access the form elements and solved it using Computed Twig fields. Not the best of all options but it works for my case. – Lance Feb 8 '18 at 10:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.