Skip to main content

Subform on Docs

If your form includes a subform, you can display its submitted data in your document templates using Docs. This gives you full control over how subform entries appear in your downloaded documents.

Updated over 3 months ago

In This Article

  • How to display a subform in your document template

  • Example of customizing a subform layout in Docs

How to Display Subforms

When you download a document template for a form that includes a subform, Array automatically inserts the correct form markers under the “Tables and Subforms” section.

Subform Marker Format:

${element-123456} ${element-123456_firstname} ${element-123456_lastname} ${/element-123456}
  • ${element-123456} begins the subform section.

  • ${/element-123456} ends the subform section.

  • Any form fields inside the subform will be listed with their unique markers (e.g., ${element-123456_description}).


Optional: Show or Hide Based on Subform Answers

If you only want to show the subform in the output when it has answers, make sure the opening (${element-xxxxxx}) and closing (${/element-xxxxxx}) markers wrap around the subform content. If no entries are submitted, nothing between these markers will appear in the final document.

Example:

Form Submission: No entries in subform
Template Output:

Start Subform: End Subform:

Result: Nothing between these lines will be displayed.

Example: Customizing a Subform

Let’s look at how to structure a subform with three fields:

  • Description

  • First Name

  • Last Name

Step 1: Form Submission (with 2 rows submitted)

Description

First Name

Last Name

Inspection A

John

Smith

Inspection B

Jane

Doe

Step 2: Customizing the Template

You can arrange the markers into a table format like this:

${element-1299699} | ${element-1299699_description} | ${element-1299699_firstname} | ${element-1299699_lastname} | ${/element-1299699}

Step 3: Download Result

Each row from the subform will repeat within the table automatically:

Description

First Name

Last Name

Inspection A

John

Smith

Inspection B

Jane

Doe

Important Notes

  • Always place the ${element-xxxxxx} and ${/element-xxxxxx} markers around the content you want to repeat for each subform row.

  • If you wrap the entire table with these markers, the entire table structure will repeat for each row. This may result in multiple full tables instead of repeated rows.

Example: Repeating the Whole Table per Row (Not Recommended)

${element-1299699} | ${element-1299699_description} | ${element-1299699_firstname} | ${element-1299699_lastname} | ${/element-1299699}

Result: One table for each row of the subform.
Best Practice: Wrap only the row portion inside the markers.

Final Tip

Subforms are flexible—just like Tables in Docs. You can fully customize the layout to match your branding or reporting needs. Be sure to test the document with a sample submission to confirm the output appears exactly as expected.

Did this answer your question?