Due date on sc_task form should be one day prior to start date
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2023 12:37 AM
Hello All,
We have an requirement ,where when user will enter the start date on form ( catalog item form ) then after submitting the form, the due date field on sc_task form should be one day prior to start date.
Any help would be appreciated.
Thank you!
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2023 02:27 AM
you can use inline f(x) script while creating the task in flow designer and set the due_date field
Just besides the set field value for Date field you will find script option.
Sample script as below
var userGivenDate = fd_data.trigger.request_item.variables.start_date;
var gdt = new GlideDateTime();
gdt.setValue(userGivenDate + ' 00:00:00');
gdt.addDaysUTC(-1);
return gdt.getValue();
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader