How to pass variables to a subflow on an sc_req_item workflow

gtke
Tera Contributor

The title pretty much says it all. I am trying to pass variables to a subflow from a WF running on sc_req_item. The workflow activity in the parent WF doesn't allow variables to be passed through it, and scratchpad variables apparently aren't passed either. Is there any way to do this?

1 ACCEPTED SOLUTION

gtke
Tera Contributor

Probir, that won't work because, as I said in the original question, you can't pass variables to a subflow from a workflow running on sc_req_item. It turns out that, in my case, I could use current.request.requested_for to get the required values so I no longer have the problem.


View solution in original post

4 REPLIES 4

abhiyadav2001
Giga Expert

Hi Garrett,



Can you try using global variables ? say, in business rules ?



I am not sure if it works or not. but its a guess.. Assign that variable to some global variable in Business rule / script include. Then access that variable by calling the same script include.



Could you please try in this way?



Thanks,


Abhijeet


ProbirDas
Tera Expert

Lets say var1 is the variable.



You can assign it to a scratchpad variable



workflow.scratchpad.wfVariable1 = var1;



Then, you can pass the scratchpad variable to the subflow.



In the workflow activity property ( where you are calling a subflow), set the "Task Item" field to ${workflow.scratchpad.wfVariable1}



Let me know if it helps.


gtke
Tera Contributor

Probir, that won't work because, as I said in the original question, you can't pass variables to a subflow from a workflow running on sc_req_item. It turns out that, in my case, I could use current.request.requested_for to get the required values so I no longer have the problem.


You just saved me a ton of time. Thank you for this post...10 years ago