Using Choice Fields in a Subflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2023 10:24 AM
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
- Create a string flow variable.
- Go to "Flow Logic," and select "Set Flow Variables."
- Choice the flow variable and use the scripting function to set the value.
- 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!