Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

how to set due date as task created date+4 days on the task table using flow designer

Rutusha
Tera Contributor

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

Rutusha_0-1743157278429.pngRutusha_1-1743157354190.png

Rutusha_2-1743157437628.png

 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Rutusha 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@Rutusha 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Shree_G
Mega Sage
Mega Sage

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.