Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

Flow Designer: 'Create Catalog Task' - need help to script the short description

danielalexa
Tera Contributor

Hi,

 

First time posting - I am looking for guidance how to correctly script a custom short description that shall pull the variable display text values correctly.

 

The variables: for simplicity renamed to "var1" and "var2"

 

What I have right now is currently throwing "undefined" errors:

 

return "License Request - " + fd_data._1__get_catalog_variables.var1.getDisplayValue() + " - " + fd_data._1__get_catalog_variables.var2.getDisplayValue() + " License";
 
This shall currently create tasks correctly yet show as "License Request - undefined - undefined License"
1 ACCEPTED SOLUTION

HarishKumar6668
Kilo Sage

Hi @danielalexa ,

If it is a Reference variable, you can use dot-walking to retrieve the display value. Assuming the Requester variable references the User table, you can use:

fd_data._1__get_catalog_variables.requester.name

 
If it is a Select Box variable, you can dot-walk through the RITM to retrieve the variable's display value. In the example below, we are accessing the RITM through the Flow Trigger and then retrieving the display value of the variable:

fd_data.trigger.request_item.variables.<varname>.getDisplayValue();   

 

If you find this information useful, please mark it as Helpful and Accept the Solution.


Regards,
Harish 

View solution in original post

5 REPLIES 5

danielalexa
Tera Contributor

Thank you very much Harish, your second statement regarding the select box variable was the correct one here and helped to solve this.

 

Have a great day - marked as the solution.

 

Thanks,

Daniel