The CreatorCon Call for Content is officially open! Get started here.

How to set due date in flow designer

Sanjay Kumar10
Tera Expert

Could you please help me to set 10 days from now on due date field using flow designer.

 

@jaheerhattiwale 

@Sandeep Dutta 

@RaghavSh 

6 REPLIES 6

Hi, did any of you find a solution to apply schedule to due date calculation on the base of delivery time from flow (not workflow), that is set by duration of flow stages) ?

In the Flow we set the Due date value with a script and it works for us.  Hope this helps!

 

var startDate = new GlideDateTime(); //your start date goes here or leave empty if you want to use current date/time
//var tZone = 'US/Eastern'; //optional - time zone will more than likely already be in your schedule.
var days = 2;
var dur = new GlideDuration(60 * 60 * 9 * 1000 * days); //60 seconds in a min, 60 min in an hour, 9 hours in a day(based on our shedule)
var schedule = new GlideSchedule('<sys_id>'); //pass the sys_id of your schedule and optional second parameter can be time zone 
var dueDate = schedule.add(startDate, dur);
gs.info("Due date " + dueDate); 
return dueDate