How can I run a script in Flow ?

nikhiljosh
Tera Contributor
 
1 ACCEPTED SOLUTION

Community Alums
Not applicable

Hi @nikhiljosh ,

You can create a script in several different Flow Actions (i.e. ‘Ask For Approval’ or ‘Update Record'). On the Action, you’ll see a scripting icon next to any field that allows scripting. This icon allows you to write inline scripts to modify values, do transformations, and more.

In the image below, you can see that there are 3 fields with scripting as an option. If you wanted to script a custom short description, you’d click on the icon that is circled:

SandeepDutta_0-1740748570569.png

 

After clicking the icon, the code editor will display the inline script as shown below:

SandeepDutta_1-1740748570572.png

 

View solution in original post

2 REPLIES 2

Community Alums
Not applicable

Hi @nikhiljosh ,

You can create a script in several different Flow Actions (i.e. ‘Ask For Approval’ or ‘Update Record'). On the Action, you’ll see a scripting icon next to any field that allows scripting. This icon allows you to write inline scripts to modify values, do transformations, and more.

In the image below, you can see that there are 3 fields with scripting as an option. If you wanted to script a custom short description, you’d click on the icon that is circled:

SandeepDutta_0-1740748570569.png

 

After clicking the icon, the code editor will display the inline script as shown below:

SandeepDutta_1-1740748570572.png

 

Ankur Bawiskar
Tera Patron
Tera Patron

@nikhiljosh 

it depends on where you wish to use.

You can use script inside f(x) inline script

You can create custom flow action where you can use script step and then invoke that action from flow

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader