How to access the display value for a catalog variable in flow designer (Create catalog task)

donnadavis
Tera Expert

I would like to add variables to the Description field of "Create Catalog Task" in Flow Designer.  I know the variables are available and can be selected using the Catalog Variables selection box.  But for readability purposes, I would like this information in the Description field of the catalog task.  Some of the fields display correctly while other are showing the sysid.  Is it possible to get the display values in the Description field?

This is the description field in flow designer

find_real_file.png

This is the description field in the catalog task

find_real_file.png

Thanks for your help.

1 ACCEPTED SOLUTION

@donnadavis 

it should be this

I assume you must be already having Get Catalog Variables Action before this

var desc1 = "Name: " + fd_data.trigger.request_item.variables.ci_user_first_name.getDisplayValue() + "\n";
desc1 += "Last Name: " + fd_data.trigger.request_item.variables.current.ci_user_last_name.getDisplayValue() + "\n";
return desc1;
 
find_real_file.png

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

12 REPLIES 12

Hi Pradeep,

I have a query, My requirement is to set the variable value in RITM for the specific Catalog Item.

I created the trigger as Service Catalog, Action Get Catalog Variable from HR Job Profile (Catalog Item). And selected all the variables there too. But got stuck in the step to set the variable's value.

Suppose, I have a checkbox variable i.e. "ABC" and like to set "True".

I tried with Run Script but still no luck.
var nameOfABCVariable = fd_data._1__get_catalog_variables.abc.getName();

gs.log("abc name: " + nameOfABCVariable);

In log, it's printing as undefined.

However, if I used like this then it returns as true even it is not defined by the user in the RITM record.
var nameOfABCVariable = fd_data._1__get_catalog_variables.abc;

gs.log("abc name: " + nameOfABCVariable);

Therefore, could you please guide or help in setting this up or is there any example available then kindly share.

Quick help must be appreciated.

 
 

 

@donnadavis 

Let me know if I have answered your question.

If so, please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

I am still trying to get the variables to work.  something I am doing is wrong because the variables keep coming up as undefined.

Hi,

please share your script

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

I changed it a lot trying to get it to work, but I think this is what I started with

var desc1 = "Name: "fd_data.trigger.current.ci_user_first_name+"\n";
desc1 += "Last Name: "fd_data.trigger.current.ci_user_last_name+"\n";
return desc1;