current is not valid in the script. You can also drag and drop the data pill into the acript and then dot walk to your field.

I think normally there should be an example in the script field i you open it the first time.

https://docs.servicenow.com/bundle/newyork-servicenow-platform/page/administer/flow-designer/concept/inline-scripts.html

This was my flow script: 

var shortDesc = fd_data.trigger.current.opened_by;
var desc ="New Hire Onboarding case for "+shortDesc
return desc;
 
this was the outcome:
 
New Hire Onboarding case for [object GlideRecord]
 
any ideas?

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

nataliya_b
Kilo Sage

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