How to convert Workflow Script To Flow desihner
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2025 02:22 AM
Hi!
In a case of a conversion from workflow to flow designer , in the first step there is a Script to set RITM fields :
current.short_description = current.variables.ritm_short_description.getDisplayValue();
var related_offering = new GlideRecord('u_m2m_service_offering_catalog_item');
related_offering.addQuery('u_catalog_item', current.cat_item);
related_offering.query();
if (related_offering.next()) {
current.service_offering = related_offering.getValue('u_service_offering');
var service_offering = related_offering.u_service_offering.getRefRecord();
current.assignment_group = service_offering.getValue('u_support_level_n1');
current.business_service = service_offering.getValue('parent');
}
And in the Catalog Task :
task.assignment_group = current.variables.sctask_assignment_group.getValue();
task.short_description = current.variables.sctask_short_description.getDisplayValue();
How to convert the workflow (begin -> Run Script (set RITM fields) -> Approval Action -> Catalog Task -> X=Set values -> end) to a flow designer?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2025 02:20 AM
@Ankur Bawiskar Is it like that? however i cat find what i need for the conditions that was scripted
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2025 06:31 AM
in your Lookup you need to add condition using your catalog variable
Like this u_catalog_item == Requested Item->Item
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2025 01:24 PM
Ive changed the flow using an assignment rule to get service offering values fields and ritm short description like this :
var cat=current.cat_item;
var gr1 = new GlideRecord("u_m2m_service_offering_catalog_item");
gr1.addQuery("u_catalog_item", cat);
gr1.query();
if (gr1.next()){
current.service_offering=gr1.u_service_offering.sys_id.toString();
current.business_service=gr1.u_service_offering.parent.sys_id.toString();
current.assignment_group=gr1.u_service_offering.u_support_level_n1.sys_id.toString();
}
current.short_description = "MARS" + " - " + current.ritm_short_description.getDisplayValue() ;
The original in the workflow was :
current.short_description = current.variables.ritm_short_description.getDisplayValue();
var related_offering = new GlideRecord('u_m2m_service_offering_catalog_item');
related_offering.addQuery('u_catalog_item', current.cat_item);
related_offering.query();
if (related_offering.next()) {
current.service_offering = related_offering.getValue('u_service_offering');
var service_offering = related_offering.u_service_offering.getRefRecord();
current.assignment_group = service_offering.getValue('u_support_level_n1');
current.business_service = service_offering.getValue('parent');
}
and system properties to get assignment group i
i just need to get short description now right like in the workflow :
task.short_description = current.variables.sctask_short_description.getDisplayValue();
if you see a mistake or can help to convert what needed from workflow to flow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2025 02:47 AM
@Ankur Bawiskar i cant find the the variables to make the conditions