Frank Tate
Giga Guru
Giga Guru

Pertaining to the Flow Designer:

In a flow or subflow you can use inline scripting to dynamically get or set a value. In this script you can access the outputs of previous steps in the flow using the "fd_data" object like this:

var myString = fd_data._1__ft_testnamesaction_parens.myoutput;

That works great. However, you'll have a problem if the name of an action contains parentheses. Unfortunately, one of the OOTB actions used in the Create Incident OOTB subflow has this characteristic, and if you try to reference that action, your subflow will fail with the error : "fd_data" not defined. Here's what the script editor will generate for you, and it will fail:

gs.info("FRANK: ciornode = " + fd_data._7__calculate_values_(based_on_the_alert).ciornode);

The script editor allows the above (and even prompts you to use it after you type the period after "fd_data". But it will fail, and it's because of the parentheses in the action name. The solution is to change the name of the action to remove the parentheses. After you do that, you need to update your inline script to:

gs.info("FRANK: ciornode = " + fd_data._7__calculate_values_based_on_the_alert.ciornode);

Then it will work. 

Please mark this article as helpful if you've found it useful.

Comments
Ravi Prasad589
Tera Contributor

 

Thank you, Frank, for your valuable inputs. Your suggestions have been instrumental in helping me identify the root cause. That said, I came across an alternative approach that also works.

 

We can create a new flow variable, for example, 'xyz', and use the flow logic "Set Flow Variables"  after the 'Calculate Values (Based on the Alert)' action. This logic would assign the 'ciornode' from the action to the 'xyz' variable.

This 'xyz' value can then be utilized in the flow script. For example:

var calculatedValue = fd_data.flow_var.xyz;

 

Additionally, specific to the OOB create incident flow, during my testing, I observed that renaming the 'Calculate Values (Based on the Alert)' action results in all fields in the 'Create Task' action being wiped out.

 

Frank Tate
Giga Guru
Giga Guru

Thank you for the kind words, Ravi.

Creating a flow variable is a great alternative. Great idea!

As for the problem you had changing the name of the action, that just sounds strange. I've had mine in production with the changed name for over a year now, and it works just like the original. Possibly something else is going on. But that doesn't matter since you have a alternative that works for you and may help others.

Thanks for sharing.

Version history
Last update:
‎10-15-2021 09:04 AM
Updated by: