Create a Choice Master XML in the [Update Choices] Step

You can create a choice master XML manually or by exporting it (see  How to Create a Choice Master XML), but with the automated step  [Update Choices] , you can save the choices held by a Select-type Data Item directly as a choice master XML (add-on file) within the workflow. Its distinguishing feature is that the update can be fully automated as a workflow step, with no manual intervention required.


Table of Contents


When to Use It

This is well suited to data where the available choices aren’t fixed, but rather data that fluctuates or changes during operation  (such as a client list or a product list). Instead of manually rebuilding the XML, you can simply update the source data and rerun the step to automatically regenerate the latest choice master, giving you a systematic, streamlined approach to maintaining your candidate list.


Setup Steps

What this Step converts into XML is the list of choice candidates held by a Select-type Data Item. The basic approach is to set the candidates dynamically by setting [Type of data source] to a “String type data item” in the Select-type Data Item’s settings, so you can swap out the choices simply by rewriting the text data. Here, we’ll walk through an example that turns a list of customers into a choice master called “Customer Master”.

  1. Prepare two String-type (multiple lines) Data Items (for example, named “Customer ID List” and “Customer Name List”). Each should contain one entry per line, with the line order pairing up choice IDs and display labels.

Customer ID List:

C001
C002
C003

Customer Name List:

Aozora Trading
Iroha Industries
Uminoki Corporation

This text data can be set not only by manual entry in a Human Task, but also from values in upstream Steps, a Script Task, or external data sources (such as Google Sheets). Rewriting this data changes the available choices. Note that if it’s fine for the display label to match the choice ID, you can select “Use choice ID as display label” and get by with just one data item.

  1. Prepare a  Select-type Data Item  (for example, named “Choice Master”). In its settings, choose “String type data item” for [Type of data source], and specify “Customer ID List” for [Choice ID] and “Customer Name List” for [Label]. Each line then becomes a selection choice. Note that the number of choices is determined by the number of lines on the [Choice ID] side, and for any choice missing a corresponding line in [Label], the choice ID itself is used as the display label.
  2. Place an [Update Choices] Step in the flow and configure it as follows.
    • [Type of Add-on to be updated]: specify either “App-shared Add-on file” or “Add-on file” (use the former if it’s shared across multiple apps)
    • [User who updates choices]: specify the user who performs the update (updating an App-shared add-on requires System Administrator privileges)
    • [Select data item whose choices will be saved *]: specify “Choice Master” from step 2
    • [Name when saving as Add-on *]: any name you like (e.g. “Customer Master”)
  1. When a Case passes through this Step, the candidates of the Select-type Data Item are converted into XML and saved as an add-on file. Depending on the type you specified, it will appear either under the System Settings’ [App-Shared Add-ons] (the “Master file of Select type data item” list) or under the App’s [Add-ons], and can also be downloaded in XML format via the download button.

Once it’s set up, whenever customers are added or removed, all you need to do is  update the String data (Customer ID List / Customer Name List) and rerun the Step . The “Customer Master” choice master will be regenerated with the latest content.


Where It’s Registered and Permissions

The add-on file saved by [Update Choices] is placed either under [App-Shared Add-ons], shared across multiple Apps, or under each App’s [Add-ons]. For details on which one to register it under, the permissions required, and the conventions for updating it, see  Creating a Choice Master XML with a Text Editor or the Modeler .


Combining with External Data

A common pattern is to save data imported from an external service into a Select-type Data Item, and then convert it into a choice master XML using [Update Choices]. See the following articles for how to import such data.


Reference Links

Discover more from Questetra Support

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

Continue reading