function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jeff JobsJeff Jobs 

Pass today's date into a variable in a FLOW

Hi,

 

I'd like today's date to automatically pass into a FLOW.

 

I've created a variable in my FLOW with the following attributes:

 

name=varTODAY

Data Type=Date

Input/Output Type=Input Only

Default Value=

 

I then created a button using a URL where "nax" is my org number and "flowname" is the actual name of my flow as follows:

 

https://nax.salesforce.com/flow/flowname?varTODAY=TODAY()

 

When I push the button I get an unhandled fault and the email I get explaining it says that the data types do not match.

 

The only thing I noticed was that FLOW dates look like this:  03/05/2013

And Salesforce TODAY() dates look like this: 3/5/2013

 

Could this really be causing the issue?  At a loss and would love some help.  Thanks!

 

Best,
Jeff Jobs

Best Answer chosen by Admin (Salesforce Developers) 
Jeff JobsJeff Jobs

So it turns out that there is a Global Variable in FLOW for today's date!

 

Create a Date variable in FLOW and assign the value as {!$Flow.CurrentDate}

 

Much easier than I thought!

All Answers

Jeff JobsJeff Jobs

Anyone?

RajaramRajaram
If you cannot set a date value var tied to a date field, please log a case. It should work.
Jeff JobsJeff Jobs

Thanks Rajaram!  Good to know that what I did should give me today's date in my flow.  

RajaramRajaram
Hmm this should work. I would log a case with support. I will check this and follow up internally as well.
Jeff JobsJeff Jobs

Submitted a case, should get a response in a couple business days.

Jeff JobsJeff Jobs

So it turns out that there is a Global Variable in FLOW for today's date!

 

Create a Date variable in FLOW and assign the value as {!$Flow.CurrentDate}

 

Much easier than I thought!

This was selected as the best answer
mukul mishra 24mukul mishra 24
Hi,
I have created a date type variable but it is not showing in value box. can anyone help me on this.
Thanks
Integration User 488Integration User 488

This does NOT work in FLOW... DATEVALUE(TEXT(YEAR( {!$Flow.CurrentDate} ))+"-12-31")

Any thoughts?

Julian Schiemann 21Julian Schiemann 21
Your formula works if you set return type to date and assign it to a date field via record update.