- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2025 03:24 AM
Hi ,
I have a requirement whenever the record is inserted into task table for a specific template then for that task record I need to set the due date as task creation date + 4 days.
For this ask I have implemented a flow and declared the flow variable and then later setting the flow variable in update record action .
But this is throwing an error .
Attaching screens for your reference
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2025 03:38 AM
script is wrong.
try this
var createDt = new GlideDateTime();
createDt.addDaysUTC(4);
return createDt.getValue();
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-28-2025 03:38 AM
script is wrong.
try this
var createDt = new GlideDateTime();
createDt.addDaysUTC(4);
return createDt.getValue();
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-28-2025 04:21 AM
Hello @Rutusha ,
Get the variable "Created on" and set the below script where you want to set the due date :
var dDate = new GlideDateTime(fd_data._3__create_record.record.sys_created_on); // Change based on your steps
dDate.addDays(4);
return dDate;
If this solution helped resolve your issue, please consider marking it as helpful or correct.
This will assist others in finding the solution faster and close the thread.