HomeGuidesRecipesAPI
HomeGuidesAPILog In

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.

978978

Another example uses repeating section for the additional data union rows, with or without a data object.

10001000

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.

357357

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.

  1. In Design, add the questions to the form.

  2. Add a new data question and select the Data Connection and Data Object. This can also be done in the Data Properties panel.

733733
  1. Go to the Data Union Properties panel.

  2. Set a row name (Applicant) and select None as Row Repeat Source. Click Add. The available display field will show.

339339
  1. In the Display Field and Reference section, use the reference picker to map the question references to the correct questions for the row.
11271127
  1. 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.

  1. In Design, add the questions to the form.

  2. Add an Emergency Contacts section and make it Repeating.

317317
  1. 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.

299299
  1. Add a new data question and select the Data Connection and Data Object. This can also be done in the Data Properties panel.

  2. Go to the Data Union Properties panel.

  3. 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.

343343
  1. Use the reference picker to map the question references to the correct questions for the row.
13311331
  1. Map rowid to the variable answer.

  2. 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.

  1. In Design, add the questions to the form.

  2. Add an Emergency Contacts section and make it Repeating.

  3. 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.

  1. Add a new data question without the Data Connection and Data Object.

  2. 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.

347347
  1. Go to the Data Union Properties panel.

  2. 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.

  3. 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.

343343
  1. Add another Row and select Secondary Applicant: Emergency Contacts from the Row Repeat Source drop-down list.
351351
  1. Map the references to the Emergency contacts of the secondary applicant.

  2. (Optional) Use Display Fields to change the name of the column headers that will display on the form in Produce.

344344
  1. Save your project.