Using Choice Fields in a Subflow

Austin_Brunet
Tera Contributor

Situation

 

I have a catalog item that has a select box choice named "Operating system" (operating_system). The flow that is connected to this catalog item uses a subflow; however, in the subflow choice fields as inputs make you create your own choices rather than use the data pill from the main flow.

 

I need this variable to use in the "if statements" within the subflow.

 

For example:

If operating system (the field that is a choice field in the main flow that the user can choose <Windows> or <Linux>) is <Windows> then do XYZ. If else operating system is <Linux> then do ABC.

 

SOLUTION

  1. Create a string flow variable.
  2. Go to "Flow Logic," and select "Set Flow Variables."
  3. Choice the flow variable and use the scripting function to set the value.
  4. The script will be similar to:
var os = "";
os = JSON.stringify(fd_data.4__get_catalog_variables.operating_system)

return os

 

the "4" is because it is the 4th action (use flow panel on right side to choice number). If it is in the trigger, use 

fd_data.trigger.xxxx

 

Hopefully this helps!

0 REPLIES 0