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

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you will have to use script for this using the f(x) for the short description

something like this

var values = '';

var sysId = fd_data.trigger.current.sys_id;

var gr = new GlideRecord('sc_req_item');

gr.addQuery('sys_id', sysId);

gr.query();

if(gr.next()){

var variables = gr.variables.getElements();
    for (var i=0;i<variables.length;i++) {
        var question = variables[i].getQuestion();
        values = values + question.getLabel() + ":" + question.getDisplayValue() + '\n';
    }

return values;

}

find_real_file.png

find_real_file.png

Regards
Ankur

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

donnadavis
Tera Expert

This is for the Description field, not Short Description.  Is the principle still the same?  I am not sure how to include all the fields I want.  Thanks.

@donnadavis 

the concept still remains the same

just select the description field instead of short description

Regards
Ankur

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

@donnadavis - To add, you can apply inline script for any field. Details below

https://docs.servicenow.com/bundle/paris-servicenow-platform/page/administer/flow-designer/concept/i...