We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Can't access to the display value of choice type variables in Flow Designer

conradofonseca
Tera Contributor

 

Here is my code:

 

 

var ritmNumber = fd_data.trigger.current.request_item.number.toString();
var typeOfDecommission = fd_data._1__get_catalog_variables.FHx_Action; // .getDisplayValue() and .display_value don't work.
var justification = 'Component retirement triggered by ' + ritmNumber + ' - automatically opened. Type of decommission: ' + typeOfDecommission;

return justification;

 

Just like it is right now, typeOfDecommission takes the catalog variable FHx_Action's value correctly, so it is having access to it, but I just don't know how to get to its display value. Please help!
1 ACCEPTED SOLUTION
4 REPLIES 4

I ended up using a GlideRecord just like in the first link. Thank you very much! 

James Chun
Kilo Patron

Hi @conradofonseca,

 

You can replace the 2nd line of code with the following -

var typeOfDecommission  = fd_data.trigger.request_item.variables.FHx_Action.getDisplayValue();

 

Cheers

Just in case someone else glances over this response like I first did: The difference here is that .getDisplayValue() only works if you do it on the TRIGGER instead of doing it on the "Get Catalog Variables" activity as the OP was doing.
The fact that ServiceNow tells you to make a custom action for this is bonkers.