DREL for Repeatable Sections
- About
- Reference one question in a repeatable section
- Reference all questions in a repeatable section
- Reference all questions in a nested repeatable section
- Reference specific answers in a repeatable section
- Reference a subset of questions in a repeatable section
- Reference all questions in one line item of a repeatable section
- Reference a question's text
About
Forms with repeatable sections will have multiple answers to the same question. DREL Data Reference Expression Language (DREL) is used to get form data and metadata and add it to a string, such as dates, usernames, or answers to questions in forms. has additional functions to allow referencing answers in Repeatable Sections.
The Data Reference Expression Language can be used to build a string using properties from the Data Record, including answer data. DREL is most commonly used for:
- Data Record Naming (controls the naming of Inbox, Draft A draft form is a partially filled-out form saved on a device, or a preliminary version of a form that's been saved but not deployed in the Form Builder. and Outbox items on mobile devices)
- Data record Document Filename Expressions (controls the naming of files routed by a data destination)
- Custom filter rules in Data Destination Filtering (filter rules determine if a data destination will execute or not)
- DREL is also used for functions specific to some data destinations, like mapping data and metadata.
Reference one question in a Repeatable Section
Reference: %a[UniqueID][n]
-
This reference is used to insert answers with Unique IDs matching the text in [ ]. These labels are found in the Pages & Questions tab in the Web Portal:
-
[n] will return the numbered answer where the row sequence starts at 0, i.e., %a[UniqueID][1] will return the second answer, and %a[UniqueID][0] will return the first.
-
Example: %a[Make] - this will display all answers to this question.
Reference all questions in a Repeatable Section
-
This reference is used to insert all data or answered questions from the section matching the text in [ ].
-
Section labels can be found on the Pages & Questions tab in the Web Portal:
-
Example: %e[TireInspection] - this will display all entered data or answered questions within this section.
Reference specific answers in a Repeatable Section
Reference: [n]
- Each answer to a repeated question or section is given an index number. You can use this reference to pull a particular answer out of the repeated section.
- Note: Reference numbers start at 0, so the first answer in a repeated section would be called using [0].
- Example: %e[Equipment][0][%a[Make]: %a[Model]]
- This will pull out the first answer to Make and Model within the Equipment section.
- Here is an example result using this DREL string:
Equipment Make 2: 2C
Reference Nested Repeatable Sections
Sometimes forms will have a repeatable section nested within another repeatable section. This requires a particular syntax to pull answers to questions.
- %e[Parent Repeatable Section ID][Child Repeatable Section ID]
Reference a subset of questions in a Repeatable Section
Using %a[UniqueID] will give you all the answers to that question, and %e[Section ID] will give you all the answers to all questions within that section. While this can be useful, it is more common to need to limit your answers further. You can do this by making a string of references. You can also add delimiters between answers, such as punctuation or other symbols.
-
Example: %e[Labor][%a[Technician Name]: %a[Tech Sub-total]][, ]
- This will return all the answers to the Technician Name and Tech Sub-total questions that are contained within the Labor section. Each linked answer will be separated by a comma.
- Here is an example using this DREL string:
Scott Stevenson: $111.48 USD, Christine Banks: $18.04 USD, Mark Miller: $50.40 USD, Peter King: $45.38 USD
Reference a Question's Text
This reference is used to insert the text of a question with a Unique ID that matches the text in [ ]. Learn more about Unique IDs.