Retrieve/Display Variable Value in Flow Designer

Erik Nelson
Kilo Sage

Hello all,

I'm an long-time admin (since Aspen) and am finally making the jump to Flow Designer when it comes to Catalog Items instead of Workflows. In a workflow, I know how to display the value of an entry in select box variables (current.variables.variable_name.getDisplayValue), but with Flow designer, I'm not sure how to recreate the same thing. I'm getting the variable values when the flow is triggered by the Service Catalog Request and dropping the data pill in place just provides me the variable name as opposed to the value selected. Ideally what I'm looking to do is populate fields like Short Description and Description with things like "Work Request - <Variable Value for Type of work>" and "Complete this work <Variable Value 1> <Variable Value 2>". I'm presuming I'll need to add some javascript, but using the fd_data isn't a route I'm familiar with.  Any help is greatly appreciated, thanks!

Erik

1 ACCEPTED SOLUTION

Carlos Candano
Mega Guru

Hi,

Unfortunately, the only way to do that is by using javascript. The Get Catalog Variables action is not able to get the display value of a select box variable. Here is a sample fd_data you can just change the <variable name> to fit your requirement.

return fd_data.trigger.request_item.variables.<variable name>.getDisplayValue();

Edit: If you just want to get the variable value, the Get Catalog Variable action should be fine. But if you are trying to get the Display Value, then you will need to use the code I have provided above.

View solution in original post

1 REPLY 1

Carlos Candano
Mega Guru

Hi,

Unfortunately, the only way to do that is by using javascript. The Get Catalog Variables action is not able to get the display value of a select box variable. Here is a sample fd_data you can just change the <variable name> to fit your requirement.

return fd_data.trigger.request_item.variables.<variable name>.getDisplayValue();

Edit: If you just want to get the variable value, the Get Catalog Variable action should be fine. But if you are trying to get the Display Value, then you will need to use the code I have provided above.