Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to use return value activity in subflow?

uma7
Kilo Guru

I want send value from subflow to mainflow and set that value in the field of mainflow.

Can anyone suggest me the process?

1 ACCEPTED SOLUTION

Kunal Varkhede
Tera Guru

Hi,

 

For that you can put your value in workflow.scratchpad.variablename and then pass that value using return value activity ${workflow.scratchpad.variablename}

 

SubFlow  

1) Run Script Activity

In Subflow you can pass your value in workflow scratchpad variable and then pass it to parent workflow using return value activity 

find_real_file.png

2)Return Value Activity

Below screenshot shows use return value activity in subflow 

find_real_file.png

Parent Workflow

3)In Parent workflow, Click on Subflow workflow and then Put that scratchpad variable name in Map return value to

find_real_file.png

4) And then use this Workflow scratchpad variable is in Parent flow in any activity of parent flow.

 

 

I hope it will help you

Please Mark Correct/Helpful answer if it help you in any way.

Thanks,

Kunal.

View solution in original post

5 REPLIES 5

Harsh Vardhan
Giga Patron

adding doc link here, kindly have a look. it has mentioned steps in details. 

 

Prepare a subflow