I'm trying to use a Webforms to create a team registration form, but I was thinking to automatically generate a participants ID number in the Webform based on certain fields in the form and based on user attributes.

The ID number is composed of 5 different fields.

  1. A group code, this is independent on the form that is being submitted
  2. A organization code, this is a multi-organization team registration, so each organization is given a specific code embedded into a participants ID number
  3. Team code, each group of people (or team) is also given a specific code
  4. Person Code, each individual person is given a number so we can distinguish persons in a team.

All of these codes are already set on the form (either through the registering user's attributes) or via the form itself. The user will not have to enter any of these attributes.

I understand in Microsoft Excel that you can combine 4 different fields by the following


But is there something similar in YAML code for Webforms?


1 Answer 1


The Webform module for Drupal 8 supports a Computed Twig element which can be used to combine and calculate a dynamic value using Twig based on multiple elements.

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.