Add short description in RITM by adding the values or filled by the user in a catalog form variable

Aakhiil
Tera Expert

Hi Experts,

I have one variable called " Request type" when ever user submit the item. variable value need to be populate on RITM "short description" . 
I have written this script in flow design but it won't work. any one please help me on this.

Note: item short description is mandatory so already given some content.But now here as per my requirment variable value only populate on RITM short desc level.

Aakhiil_1-1682941648454.png

also i tried this script 
current.short_description= current.variables.request_type;

Aakhiil_2-1682942089929.png


Any help will be appriciated.

Thanks in Advance


1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Aakhiil 

why to update the RITM in GET Catalog variables step?

you can use update record action and set the short_description like this

No scripting required; just drag and drop the Pill

AnkurBawiskar_0-1682951394254.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

14 REPLIES 14

Sandeep Rajput
Tera Patron
Tera Patron

@Aakhiil In the following actionAakhiil_1-1682941648454.png

You are querying the sc_request table and setting the description on it. Whereas you mentioned that you need to do it on the RITM short description.

 

Also, in the following image you have highlighted the short description of Catalog item whereas you should be checking the short description of the RITM.

SandeepRajput_0-1682943565531.png

 

Here you can find the RITM.

Screenshot 2023-05-01 at 5.52.13 PM.png

Hi @Sandeep Rajput 
Thanks for your response. I have used this script in Flow design update record action. Somehow i am not able to get/pill the item variables so i am using this script but failed.Can you please correct me 

var gr = new GlideRecord('sc_req_item');
gr.addQuery('request_item',current.request_item);
gr.query();
while(gr.next())
{
gr.short_description = current.variables.request_type;
gr.update();
}


@Aakhiil You should be able to find requested item inside the trigger variable. Please refer to the following screenshots to access the requested item inside trigger variable in flow.

 

Screenshot 2023-05-01 at 9.02.49 PM.png

Screenshot 2023-05-01 at 9.01.13 PM.png

 

You do not have to write script to update short description simply use the update record action and select the record from trigger>Requested Item in data pill. You can also use Get Catalog Variables Action to extract values of variables submitted on the catalog item.

Hi @Sandeep Rajput 
Appreciated .Thank you so much your help.