How to pass output of one custom action to another custom action in flow designer

Priya75
Tera Contributor

Hi All,

 

I am working with custom action in flow designer, i need to pass few values from one custom action to another , how can i do that. eg i have got the ouptputs.returnvalue=sys_id; 

 now i want to pass this in another action .

3 REPLIES 3

Eshwar Reddy
Kilo Sage

Hi @Priya75 

Go to the “Output” tab of your custom action and add a new output variable. For example, if you want to output sys_id, you can add an output variable named sys_id and set its type to String.

  1. Name: sys_id
  2. Type: String

Ensure that your custom action’s script or logic assigns a value to this output variable. For example, if you’re using a script, you might have something like:
output.sys_id = current.sys_id;

When configuring the next action, you can access the output values of the previous custom action.

Click on the “Data Pil” icon or use the Data Picker to select the output variable from the first custom action. This will allow you to use sys_id in subsequent actions



Action 1: Custom Action 1 (outputs sys_id)

Action 2: Custom Action 2 (inputs sys_id from Action 1)

In the Flow Designer:

  1. Action 1: Configure to output sys_id.
  2. Action 2: Configure its inputs to receive sys_id from the output of Action 1.

is there any other way to get the value in 2nd action, as i am also getting the trigger record( object) in the data pil of second action.

Stefan Reichelt
Tera Guru
Tera Guru

When you create a custom action, it's important to be aware that each single step has inputs and outputs, and the action itself has the same. At the bottom of each step, you define all the required output variables of that step. As you already wrote, you can then assign values to the variables that you previously defined.

In the next step, you define inputs again, and there you can access the outputs of the previous one:

StefanReichelt_0-1726122480536.png

I tried to visualize the data flow with red arrows. Step 1 has an output, and I use it as a source for my input example in Step 2. There I assign the example output. The action itself has an output again, and that is defined in the "Outputs" section.

 

If you're new to the topic, I can recommend the course on Now Learning. As a reward, you can even get a shiny Micro Certification.

Flow Designer Fundamentals - Now Learning (servicenow.com)