Data Union
Overview
Data Union gathers data from different sources into a data source question with the extra information behaving like part of the data question.
Important
- Data Union is similar to SQL UNION in that it adds rows to the data but will NOT combine the data into a single row.
- A Data Union question on its own will not write or save data to a table. To permanently store data, use either a Custom Data Object, Call SQL Procedure Action or a similar action.
In this example, Data Union shows the existing data from the data question as well as the answers entered into the form by using static questions for the data union row. Refer to Using Static Questions.
Another example uses repeating section for the additional data union rows, with or without a data object.
Information from the different sources can be configured from the Data Union panel, where you can use the field reference picker to reference the values or the Display Fields to change the column headers displayed.
Additional Information
- Display Field will only show available items from the Data Connection in the properties panel. No fields can be added from this panel. However, you can use Results Transformation to add/remove the schema fields to display or Display Fields to change how the column headers are displayed.
- Additional rows can be sourced from:
- Static non-repeated questions
- Repeating sections
- Data questions
- Combinations of the above
- Data Union does not support:
- SmartIQ Data Objects, except Custom Data Objects
- Chained Data Union
Usage
Using Static Questions
Using a static question provides the option of displaying the specified answers to the questions. This is the most basic way of using Data Union as you can directly map the display field to the answers in the form.
-
In Design, add the questions to the form.
-
Add a new data question and select the Data Connection and Data Object. This can also be done in the Data Properties panel.
-
Go to the Data Union Properties panel.
-
Set a row name (Applicant) and select None as Row Repeat Source. Click Add. The available display field will show.
- In the Display Field and Reference section, use the reference picker to map the question references to the correct questions for the row.
- Save the project.
Repeating Sections as Source
Similar to using a static question, using repeat source as the source provides the option of displaying the specified answers to the questions. However, with Repeat sections, a unique identifier needs to be provided to ensure that each additional answer can be added as well.
-
In Design, add the questions to the form.
-
Add an Emergency Contacts section and make it Repeating.
- Add a variable for the unique identifier to the form.
Unique Identifiers
Map unique fields for data sources to ensure that selected values are retained.
-
Add a new data question and select the Data Connection and Data Object. This can also be done in the Data Properties panel.
-
Go to the Data Union Properties panel.
-
Set a row name
Emergency Contacts
and select Applicant: Emergency Contact from the drop-down list as Row Repeat Source. Click Add. The available display field will show.
- Use the reference picker to map the question references to the correct questions for the row.
-
Map
rowid
to the variable answer. -
Save the project.
Using Repeating Sections as Data Source
In certain scenarios where you do not want to have a Custom Data Object, use a repeating source as the data union source for the row.
-
In Design, add the questions to the form.
-
Add an Emergency Contacts section and make it Repeating.
-
Add a variable for the unique identifier to the form.
Unique Identifiers
Map unique fields for data sources to ensure that selected values are retained.
-
Add a new data question without the Data Connection and Data Object.
-
In the Data Properties panel, select Repeating Page/Section from the Data Connection drop-down list and the repeating section name Applicant: Emergency Contact from the drop-down list.
-
Go to the Data Union Properties panel.
-
Set a row name
Emergency Contacts
and select None from the drop-down list as Row Repeat Source. Click Add. The available display fields will show the references from the Repeating section. -
Select the None from the Row Repeat Source drop-down list and leave the references blank as this row already references the emergency contact of the first applicant.
- Add another Row and select Secondary Applicant: Emergency Contacts from the Row Repeat Source drop-down list.
-
Map the references to the Emergency contacts of the secondary applicant.
-
(Optional) Use Display Fields to change the name of the column headers that will display on the form in Produce.
- Save your project.
Updated over 2 years ago