How to run a script in subflow

SHALIKAS
Tera Guru

We have a sub workflow which is used in all the catalog items. This has a run script activity which GlideRecords the sc_request table to populate some values. After that it waits for some duration and then a notification is sent. Now we are updating this to sub flow, As I am new to flow designer I am not able to get that how to run the script. Please help on this

1 ACCEPTED SOLUTION

Kavita_Bhojane
Tera Guru

Hi @SHALIKAS ,

 

Create a Subflow as below:

1. Define required inputs. Output not required

2. Use action "Update Record" to set Short Description and Requested For

To set "Requested For" use below script:

var reqFor;
if(fd_data.subflow_inputs.onbehalf_of_someone == "No"){
reqFor = fd_data.subflow_inputs.requester;
}
else{
reqFor = fd_data.subflow_inputs.requested_for2;
}
return reqFor;
3. Save
4. Now add Subflow in your flow and map required inputs.
5. Save and test the flow.
 Kindly refer attachments.
 

Please mark my answer helpful and accept as a solution if it helped 👍✔️

Thanks,
Kavita Bhojane

 

 

View solution in original post

7 REPLIES 7

Ranjit Nimbalka
Mega Sage

Hi @SHALIKAS ,

 

You do not need any script for this you can use action update record pass the table name as sc_request and populate field which you want.

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,
Ranjit

Hii, I need to add the following script, it also has if conditions

SHALIKAS_0-1713260561239.png

 

Hi,

 

initially use action "Get Catalog Variable" you will get all the variable user is entering on the form and then If condition and then use update record and set those value in request.

 

Regards,

Ranjit

But I want to use this subflow for all the catalog items not for a particular one. So how can I select the variables in that case