We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

how to get the model name catalog item from to the short description for SCtask ?

chercm
Mega Sage

i have created a catalog item form and attached the flow designer to create SCtask ticket but i cannot the model name to be populated on the short description field 

 

what  should i select ?

 

Screenshot 2023-10-06 at 6.07.53 PM.png

Screenshot 2023-10-06 at 6.08.26 PM.png

1 ACCEPTED SOLUTION

Hi @chercm 

 

There is also a another way :

 

Step 1 : Create flow variable 

 

VishalBirajdar_0-1696589377334.png

 

VishalBirajdar_1-1696589419977.png

 

It will look like this in data picker

VishalBirajdar_3-1696589544682.png

 

 

Step 2 : Create flow logic "Set flow variables"

 

VishalBirajdar_2-1696589488084.png

 

Use Toggle script to set the value (Highlighted in blue)

In script  write below code 

 

var model = fd_data.trigger.request_item.variables.<your_variable_name>;
return model;

 

VishalBirajdar_5-1696589659716.png

 

Step 3 : Drag & drop the flow variable in Short description of Catalog task 

 

VishalBirajdar_6-1696589806758.png

 

 

Note : for demo I have used "RITM" table.

 

 

 

 

 

 

 

 

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

View solution in original post

16 REPLIES 16

Ohhoo...I see it is referencing to "alm_consumable"

 

In the "Set flow variable" put this script :

 

var model = fd_data.trigger.request_item.variables.<your_variable_name>;
var displayValue;
var grCom = new GlideRecord('alm_consumable');
grCom.addQuery('sys_id', model);
grCom.query();

if(grCom.next()){
displayValue = grCom.getDisplayValue();
}

return displayValue;

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

@VishalB06557037  i noticed when i pass in the user name into the variable which is correct on the ritm , but the short description the model information became garbage and the requested for is also changed to system admin 

chercm_3-1696594211183.png

 

chercm_1-1696594127648.png

 

 

chercm_2-1696594156760.png

 

Hi @chercm 

 

As its reference field , you can do some modification in flow logic "Set flow variable" script

 

In the "Set flow variable" put this script :

 

var model = fd_data.trigger.request_item.variables.<your_variable_name>;
var displayValue;
var grCom = new GlideRecord('alm_consumable');
grCom.addQuery('sys_id', model);
grCom.query();

if(grCom.next()){
displayValue = grCom.getDisplayValue();
}

return displayValue;

 

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

@VishalB06557037 how can i pass the user name to the sctask?

@chercm  from which field you want to get User name ..??

Requested for ...??

 

if yes then you can dot-walk on requested for field in flow till user name.

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates