- What are Subforms?
- How do I pass data from a Parent form to a Subform?
- How do I pass data from a Subform to a Parent form?
- Form Packages
What are Subforms?
Subforms can be used to condense your form and break up larger form sections into smaller forms.
How do I pass data from a Parent form to a Subform?
To pass data from a Parent form to a Subform, please follow the instructions below.
STEP 1. You must first create your Parent form. In this example, we'll be creating a simple Parent with a Text element and a Subform element.
STEP 2. In the Dynamic Value of your Text element, put pass_data_parent_to_sub.pass_data_1
This will set the element to an empty string and ensure that the element value resets with each new record. The format is parent_form_name.element_name
STEP 3. Now we'll create our Subform. In this example, the Subform will include a Text element with a data column name of data_from_parent.
STEP 4. In the Dynamic Value of the Text element, put: pass_data_parent_to_sub.pass_data_1
- pass_data_parent_to_sub is the table name of the parent form.
- pass_data_1 is the element name on parent form from which data is passed to the subform.
PLEASE NOTE: You can find the table name at the bottom of the Form Builder as shown below. Be sure to navigate back to the parent form in the Form Builder to get the correct table name.
STEP 5. Back on the Parent form, link the Subform you just created to the Subform element on the Parent form.
Highlight the Subform element, and from the Smart Paging tab, select Subform List.
Search for the Subform you created and select it.
STEP 6. The Parent form and Subform are now linked. Test on your device to ensure the data passes from Parent to Subform.
How do I pass data from a Subform to a Parent form?
Your workflow may require that data entered on a subform level to show on a higher level. The example below will walk through how to do just that.
STEP 1. On the Subform we created above, add a Text element with a data column name of data_to_parent.
STEP 2. In the Dynamic Value of your Text element, put passing_parent_data_subform.data_to_parent
This will set the element to an empty string and ensure that the element value resets with each new record. The format is subform_name.element_name
STEP 3. On the Parent form we created above, create a Text element with a data column name of data_from_subform.
STEP 4. In the Dynamic Value field of the element put the following:
We'll go over what all of that means, next.
- pass_data_parent_to_sub: This is the Table Name of the Parent form.
- my_subform_element: This is the data column name of the Parent form's Subform element. This is where most users go wrong when setting up this functionality. This is not the element on the Subform or the Table Name of the Subform. It is the data column name of the Subform element on the Parent form.
- : This is the position in the array. For example, a single-paging subform would always be , but a multi-paging subform could be  or any number higher than that.
- data_to_parent: This is the element on the Subform itself that you're passing the data from.
STEP 5. Test on your device to ensure the data passes from Subform to Parent.
Passing Data Form Packages
Below are a couple of form packages that we think you'll find useful. One is a form package of the forms will built out in this tutorial. The other was put together by our resident yoda, Tony, showing how to pass data between different levels of Subforms. Import them into your profile to help get you started.