Multiple sections (loops)

How to repeat the same group of fields in a form

Remember the article creating tags for multiple sections, where we talked about the repetition of the same group of information in the purchase of an airline ticket for several passengers?

In cases like this, in addition to using the appropriate tags, you must also configure the form so that this repetition becomes possible. So let's continue with the example of a lease agreement, in which the number of tenants may vary from one contract to another.

 

First, let's remember the use of tags:

Without tags

On the other hand,

 

as LESSEE, Mr. / Ms. ___________, of legal age, domiciled in ___________, with ID number ___________, email ___________, and the following telephone number: _________.

 

With tags

{#tenant}On the other hand,

 

as LESSEE, {#gender_m}Mr.{/gender_m} {#gender_f}Ms.{/gender_f} {tenantName}, of legal age, domiciled in {address}, with ID number {idNum}, email {email}, and the following telephone number: {phone}.

 

{/tenant}

 

In the example above, we have used a line break before the closing tag {/tenant} so that when duplicating the paragraph there is a separation between the two. Learn more about line breaks here ⇢

 

Secondly, let's see how to transfer this structure to the form. We will do the following:

  • Once we have created all the necessary fields that we want to be repeated for each tenant, drag all these fields to the same section of the form.
  • Convert this section into a multiple section as shown below.

 

STEP 1 - Drag all the fields to the section we want to convert to multiple and when we hover the mouse over it, then Settings button appears.

Captura de pantalla 2021-10-04 a las 7.46.09

STEP 2 - When we click on it, a drop-down appears with different alternatives. Click on Options.

Captura de pantalla 2021-10-04 a las 7.50.15

STEP 3 - The panel to activate the transformation of the section to Multiple appears. Click on the button highlighted in red in the following image.

Captura de pantalla 2021-10-04 a las 7.49.55

STEP 4 - Once activated we can configure the multiple section, adding the corresponding label, as we have seen in the example above.

Captura de pantalla 2021-10-04 a las 7.46.39

*The 'Connector' option applies only in cases where we use a multiple section to list repeated text fragments within the same paragraph. It allows you to select between the punctuation mark formats that are best suited to separate the information:

______, ______ and ______
______, ______ or ______
______; ______ and ______
______; ______ or ______

(don't forget that for these connector types to work we must write the {JOIN} tag in our template document). You can see how to use this tag here ⇢

STEP 5 - Save and see how an icon has appeared in the top right corner of the section, indicating that it is configured as multiple.

Captura de pantalla 2021-10-04 a las 7.47.14

 

Let's see how this works in our final document: