Setting a Due Date in Flow Designer to be 7 days before a Date that is set in my Trigger Record

kdelbridge
Tera Expert

Hello!

I have created a task in my flow and I need to set the Due Date to be 7 days prior to a date that is already defined on my Trigger Record.

Would I need to create a flow variable for this?

I am just now learning scripting, so any help you can offer would be greatly appreciated.

I do know that I want my due date for this task to be 7 days prior to this date that can be pulled from my flow. 

  • fd_data.trigger.current.target_closing_date

Many thanks in advance!

1 ACCEPTED SOLUTION

James Chun
Kilo Patron

Hey @kdelbridge,

 

Instead of scripting, you may be able to use Transform functions in Flow.

e.g.

JamesChun_0-1708042359767.png

 

Hope it helps, thanks

View solution in original post

5 REPLIES 5

James Chun
Kilo Patron

Hey @kdelbridge,

 

Instead of scripting, you may be able to use Transform functions in Flow.

e.g.

JamesChun_0-1708042359767.png

 

Hope it helps, thanks

Thank you @James Chun , this worked.  I totally forgotten that I had learned about this before. It is not imprinted and I will remember this next time.  Appreciate you!

Harish KM
Kilo Patron
Kilo Patron

Hi @kdelbridge you can use the below script on the field you want to set future date.

var due_on = new GlideDateTime();// todays date
due_on.addDaysLocalTime(7); //set 7 days from today's date
return due_on;
Regards
Harish

Hi @Harish KM ,

Thanks for your response.

I think that will get me close to that what I need to accomplish, but I need the due_date of the task that I am creating in my flow to be set to 7 days BEFORE the date that is already defined in my trigger record.

 

my closing_date of my current trigger record can be found in 

fd_data.trigger.current.closing_date
Assuming the closing_date on my trigger record is 3/8/24 and if I want the task I am creating in my flow to be equal to 7 day before, then when my flow creates this task, I need the due_date to return the value of 3/1/24 which is 7 days prior to 3/8/24.
Both field types from my trigger record and the field I wish to populate are glide_date_time field types.
 
Does that make sense for what I need to accomplish?