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.

Using flow designer to set field value via script

JJG
Kilo Guru

Hello,

I have a flow in flow designer and I would like to set the "Opened for" field to be set to the current value of the "Opened by" field. I have been using the following script but it doesn't seem to work:

find_real_file.png

Both the open_for & the open_by fields are reference fields to the user table, is that why this is not working? How should I fix this? Any help is appreciated.

1 ACCEPTED SOLUTION

Solved: 

var shortDesc = fd_data.trigger.current.opened_by.getDisplayValue();
var desc ="New Hire Onboarding case for "+shortDesc;
return desc;

View solution in original post

7 REPLIES 7

Solved: 

var shortDesc = fd_data.trigger.current.opened_by.getDisplayValue();
var desc ="New Hire Onboarding case for "+shortDesc;
return desc;

nataliya_b
Tera Guru

have you tried to use script as below

var openFor = current.opened_by.toString(); //check for the field name as well

This does not seem to work