Building a Choice Master with [Update CSV Data]

[Update CSV Data] lets you extract the data you need from CSV. Also, the choices in a [Select-type] Data Item consist of two fields: “Choice ID” and “Display label.” By combining [Update CSV Data] with [Update Choices], you can extract the necessary data from a CSV and create a Choice master file from that data.

Here, we introduce how to build an app that automatically creates a Choice master file — using email addresses as Choice IDs and names as Display labels — based on CSV data from an employee directory.

[Update CSV Data] related articles:

1. What Is a Choice Master?

Choices for a [Select-type] Data Item are defined as combinations of “Choice ID” and “Display label.” A Choice master is an XML-format file that defines multiple such combinations. When registered as an Add-on, it can be referenced as a common set of choices from multiple apps.

For details on the format of a Choice master and various methods of creating one, see the following articles. This article focuses specifically on how to build a Choice master from CSV using [Update CSV Data].

Reference articles:

2. Choice Master Auto-Create / Update App

This app receives CSV data from an employee directory (input) and automatically creates and registers a Choice master file of names and email addresses (output). When the source CSV data is entered, names (Display labels) and email addresses (Choice IDs) are extracted and registered as a Choice master file in Add-ons. If the directory is updated and the flow is re-executed, the Choice master is updated to the latest content.

App Definition

Workflow Diagram

Following the Human Task where the source CSV data is entered, place an [Update CSV Data] step and an [Update Choices] step. Each step handles the following processing. (Detailed settings are described later.)

[Update CSV Data]: Extract Display labels and Choice IDs

Extracts names (Display labels) and email addresses (Choice IDs) from the source employee directory CSV data, and saves each to a String-type (multiple lines) Data Item. The step name is “Data Extraction.”

[Update Choices]: Create a Choice master from Display labels and Choice IDs

Creates a Choice master file from the [Select-type] Data Item that references the two Data Items output by [Update CSV Data] as choices, and registers it as an Add-on. If a file with the same name already exists, it is updated. The step name is “Create / Update Choice Master.”

Data Items

Prepare the following Data Items.

Data Item NameData TypeDescription
CSV DataString (multiple lines)Stores the source CSV data.
Choice IDString (multiple lines)Stores the Choice IDs extracted from the CSV data.
Display labelString (multiple lines)Stores the Display labels extracted from the CSV data.
Choices for Create / Update Choice MasterSelectThe Choice master is created/updated based on the choices of this Data Item.

For the [Select-type] Data Item “Choices for Create / Update Choice Master,” set [Type of data source] to [String-type data item], specifying “Choice ID” for [Choice ID] and “Display label” for [Display label].

3. [Update CSV Data] Step Settings

Extract the two columns corresponding to the Display labels and Choice IDs from the source CSV data, and save each to a separate String-type (multiple lines) Data Item.

[Query]

  • Write a query to extract the columns for the Display labels and Choice IDs.

[Save Settings]

  • In [C4: How to save query results], select “Save the values of each column to a data item, separated by line breaks.”
  • In [C4a: Data item that will save query results], specify the destination Data Item for each column of the query results individually.

Configuration Example

Query Example

SELECT "Name","Email"
FROM "Directory"

This extracts the values of the “Name” column and “Email” column from the data whose [C1b: Table name when accessed by query] is set to “Directory.”

C4a (Destination Data Items)

Query Result ColumnDestination Data Item
1st column (Name)String (multiple lines) “Display label”
2nd column (Email)String (multiple lines) “Choice ID”

Input/Output Results

Extracting 2 items and outputting to String (multiple lines)

Reference: Help page “Update CSV Data”

4. [Update Choices] Step Settings

From the [Select-type] Data Item that references the two String-type (multiple lines) Data Items output by [Update CSV Data] as choices, create or update a Choice master file and register it as an Add-on. For the target [Select-type] Data Item, configure it in advance to reference String-type (multiple lines) Data Items as choices.

[Type of Add-on to be updated]

  • Choice Master (App-Shared Add-on): Specify this when registering as an [App-Shared Add-on].
  • Choice Master (Add-on): Specify this when registering as an App-specific Add-on.

[User who updates choices]

  • Clicking the [Me] button specifies the operating user.
  • The specified user must have the appropriate administrative privileges depending on the Add-on type (Choice Master (App-Shared Add-on) = System Administrator privileges / Choice Master (Add-on) = App Administrator privileges).

[Select data item whose choices will be saved]

  • Select the [Select-type] Data Item “Choices for Create / Update Choice Master” from the pull-down.

[Name when saving as Add-on]

  • Specify the file name of the Choice master file (e.g., choice-master-name-email.xml). Include the extension (.xml).
[Update Choices] step settings screen

Reference: Help page “Update Choices”

5. Verification

Once the settings are complete, run a debug execution from the first [Start Event]. When you enter the source CSV data in the Human Task, all subsequent processing is completed automatically. The results can be verified at the following locations, depending on the [Type of Add-on to be updated] setting in [Update Choices].

  • For Choice Master (App-Shared Add-on): [System Settings] > [App-Shared Add-on] > [Master file of Select type data item]
  • For Choice Master (Add-on): App Details > [App] > [Manage Add-ons] > [Master file of Select type data item]

In either case, if a file with the name specified in [Name when saving as Add-on] has been added to the list, the configuration is successful. On the list screen, you can verify the contents and download the file.

6. Summary

By combining the “Save the values of each column to a data item, separated by line breaks” feature of [Update CSV Data] with [Update Choices], you can build a flow that automatically creates and registers a Questetra BPM Suite Choice master from externally obtained CSV data (such as customer lists or employee directories). Simply re-executing the flow whenever the directory changes keeps the Choice master up to date, significantly reducing the effort required to update and manage choices.

Discover more from Questetra Support

Subscribe now to keep reading and get access to the full archive.

Continue reading