- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2020 02:27 AM
Hi All,
How to write script in flow designer.
I want to write the below code in flow designer,
var groupValue=gr.assignment_group.u_auto_close_duration;
var half = (groupValue/2).toFixed(2);
var roundingValue=Math.round(half);
var gDate = new GlideDate();
gDate.addDays(roundingValue);
gr.work_notes="This case has been marked Resolved. It will be auto closed on"+" "+gDate+" "+" if you do not take action.";
Here i want to write the script. Please help me how to write.
Thank You,
Sai.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2020 01:24 AM
Create custom action here so scripting will be done in custom action, and then you will use that action in your flow designer.
Doc link for further details.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2020 05:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2020 04:35 AM
Hi Sai,
Change the first line as per Asifnoor's code to
var groupValue = fd_data.trigger.current.assignmment_group.u_auto_close_duration; //object should be fd instead of d
Thanks,
Mohit Kaushik
Mohit Kaushik
ServiceNow MVP (2023-2025)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2020 04:45 AM
Hi Mohit,
I changed it, but it still not working throwing an error.
Thank You,
Sai.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2020 01:24 AM
Create custom action here so scripting will be done in custom action, and then you will use that action in your flow designer.
Doc link for further details.