Using Runtime Selection
  • 02 Jun 2021
  • 3 Minutes to read
  • Dark
    Light
  This documentation version is deprecated, please click here for the latest version.

Using Runtime Selection

  • Dark
    Light

Article summary

Overview

The Runtime Selection Property provides the ability to map which Target Id (Flow or Rule) within a Sub Process (ie. Run Sub Flow or Run Rule step) is called upon at Runtime. As this differs from the Target selection's Inputs, which are known at Design time, users are given the option to define Inputs via the Additional Data For Flow option, allowing for more dynamic mapping options. The following document explains and demonstrates the options that are available when using Runtime Selection.

Additional Information
For more information regarding Sub Flows see Using Sub Flows.

Use Case

Please note this is a description of a sample use case. The Runtime Selection property can be used in many different ways.

A process needs to run a Flow based on what day of the week an item is submitted. For example; Monday has logic that differs from Tuesday's logic. This Flow would return a score. A different Flow has to be run depending on the day of the week.
Though the logic within each Flow is different, their Input and Output names are the same.

The Flow set for Target is the Flow that takes in the data and outputs a score. At Runtime, the Flow will determine the day of the week, then fetch the proper Flow Id, and pass that into the Target Id input using Select From Flow.


Enabling Runtime Selection 

To set the Flow/Rule to allow a selection at Runtime:

  1. From the Flow Designer, attach the desired step (either Run Sub Flow or Run Rule) to the Start step, or the proceeding Process logic. 
  2. From the Properties tab of the newly added step, under Advanced > Selection Type, select Runtime Selection Enabled.
  3. Still in the Properties tab, Pick or Create a Target. Then map in the desired Target Id
    Additional Information 
    Target represents the Rule or Flow being used within the Flow. Target Id is an Input that only appears when Runtime Selection is selected.

    The Target ID represents the ID of the Flow that is being called on whenever the Run Sub Flow or Run Rule step is reached in a process at Runtime.

    Establishing a Target exposes the Inputs and Outputs of that Flow or Rule. To run a dynamic Flow that takes in Inputs, those Inputs can only be specified if the Target has the same ones.


    Further, given that the Inputs of the Target Id Flow or Rule are unknown at Design time, users must map Additional Data For Flow.

  4. If applicable provide Additional Data For Flow (see section below for additional information) by selecting Add New, defining the Data, then clicking OK. Then map the Input via the Properties tab. 



Additional Data For Flow 

The primary purpose of the Additional Data For Flow panel is to provide Input data to a Flow where the exact Input Data parameters are unknown at Design time.

Additional Information 
Note that this applies to situations where Runtime Selection Enabled is chosen from the Selection Type dropdown box.

Enabling Runtime Selection adds the additional Target Id parameter which allows users the ability to choose which Flow to link by passing a Flow Id. Given that the Flow ran at Design time is unknown, the Flow's Input data parameters can not be mapped directly.

Instead, the data values are added in the Additional Data For Flow panel. The established Additional Data will be then be passed through if it matches the linked Flow's Input data.


Add Additional Data For Flow Table
The following table represents the inputs/options available pertaining to Additional Data For Flow and the way it is passed through. 
Property Description 
Output data name This allows users to input a name for the data.
Data type This drop-down allows users to select a datatype for the additional data. 
Can be nullEnabling this box allows the data to have a null value
Is listEnabling this box defines the data as a list. 
SelectEditor Checking this box gives users access to the Property Editor which allows users the ability to select from a drop-down list of properties that can be applied to the data.

Get Flow/Rule ID

To have a Flow/Rule ID available as a Constant for the Target Id:

  1. Navigate to the Flow or Rule that will be used as a Runtime Selection.
  2. From the Action menu navigate to Manage > Get Flow/Rule ID
  3. Select Copy Text, then click DONE. 



Was this article helpful?