Flow - scripted Short Description to include variable text

Baggies
Kilo Guru

Hello.
In Flow Designer, I am trying to populate the Short Description of a catalog task, with a variable.

My variable is a choice - Request Type, whose value is request_type
One of my questions (choice) is Site Access, value is site_access.
See screenshot.

I have tried the script as follows:
var shortDesc = "Some text -  " +  d_data.trigger.current.variables.request_type;
and also 
var shortDesc = "Some text - " +fd_data.trigger.current.variables.request_type.getDisplayValue();
and also
var shortDesc = "Some text - " +fd_data._1__get_catalog_variables.request_type;

But the Short Description is always returning Some text - site_access.

Thanks for any help. It's driving me mad 🙂

find_real_file.png

 

3 REPLIES 3

Mike Patel
Tera Sage

try

return "Some text - " + fd_data.trigger.request_item.variables.request_type.getDisplayValue()

or

var shortDesc = "Some text - " + fd_data.trigger.request_item.variables.request_type.getDisplayValue()
 

Thanks for the replay Mike, I know you're a good contributor here.

This unfortunately did not work for me. I did figure out a script like the one below that worked, but I ma not happy having to script for such a simple thing...not convinced about Flow yet. 

Cheers,

Mark S

var shortDesc = "";
if (fd_data._1__get_catalog_variables.request_type == "site_access"){
shortDesc = "Site Access";
} else{
shortDesc = shortDesc = "This is NOT Site Access Request";
}
//gs.info("shortDesc: " + shortDesc);
return shortDesc;

GB14
Kilo Patron

Have you tried something like this - https://community.servicenow.com/community?id=community_question&sys_id=aca79d8c1b969850d2ccea89bd4bcbd4