The CreatorCon Call for Content is officially open! Get started here.

How to script in Flow Designer

ceraulo
Mega Guru

Hello!
I've recently started using the Flow Designer to create workflow for our Catalog Items.
In the traditional workflow, customizing the Short Description is shown below.

task.short_description = current.variables.variable1 + " - " + current.requested_for; 

In Flow Designer, I tried the below but it does not work.

var shortDesc = fd_data.trigger.request_item.variables.variable1 + ' - ' + fd_data.trigger.request_item.requested_for;
return shortDesc;

Please help!

Thank you.

1 ACCEPTED SOLUTION

Maik Skoddow
Tera Patron
Tera Patron

Hi @ceraulo 

it is not necessary to script something.

You just can do this by pulling the respective data pills into the Short Description in an "Update Record" action.

find_real_file.png

Kind regards
Maik

View solution in original post

5 REPLIES 5

Maik Skoddow
Tera Patron
Tera Patron

Hi @ceraulo 

it is not necessary to script something.

You just can do this by pulling the respective data pills into the Short Description in an "Update Record" action.

find_real_file.png

Kind regards
Maik

Hi,

Like Maik said, no scripting is required in this case.

Watch this video from Robert Fedoruk to get an example on how to combine fields without scripting. (you can fast forward to 6:30 if you like)

This worked. Thank you.

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

use this

1) use Get Catalog Variables action and include those variables

2) then use that in script by dot walking

3) also requested_for field is on REQ and not RITM

Something like this

var shortDesc = fd_data._1__get_catalog_variables.variable1 + ' - ' + fd_data.trigger.request_item.requested.requested_for.name;
return shortDesc;

Regards
Ankur

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