- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2023 03:08 AM
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 ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2023 03:57 AM
Hi @chercm
There is also a another way :
Step 1 : Create flow variable
It will look like this in data picker
Step 2 : Create flow logic "Set flow variables"
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;
Step 3 : Drag & drop the flow variable in Short description of Catalog task
Note : for demo I have used "RITM" table.
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2023 04:40 AM
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;
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2023 05:10 AM
@Vishal Birajdar 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2023 05:15 AM
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;
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2023 05:21 AM
@Vishal Birajdar how can i pass the user name to the sctask?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2023 05:24 AM
@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.
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates