cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AVH Advocate I
Advocate I

Is there an expression in Flow like =TODAY() in Excel that gives today's date as output?

Hi All, 

 

I am looking for an expression much like 'utcNow()' that gives today's date as an output. That way I can compare it to the 'Due Date' column and send an  email when a task is (over)due. 

 

I Excel you can use the formula '=TODAY()' to do that, but that doesn't seem to work in flow. 

Does a similar expression exist in Microsoft Flow?

 

Best regards, 

AVH

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Re: Is there an expression in Flow like =TODAY() in Excel that gives today's date as output?

Hi @ AVH,

Thank you for posting.

What is format of “Due Data” in your column?

You could add a “Compose” action and take a try to use expression below:

Expression:

formatDateTime(utcNow(),'yyyy-MM-dd')

Use this Expression would return a data like 2018-01-24

 

 

Image reference:

 1.jpg

 

2.png

 

 

More details about the Workflow Definition Language, please check the link below:

https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language

 

 

I have a sharepoint list and the list have a Date type due data field.

 3.png

I have made a flow to compare the due data with the date now. please refer to screenshots below:

4.png

 

The expression of first value as below:

formatDateTime(triggerBody()?['duedate'],'yyyy-MM-dd')

 

The expression of second value as below:

formatDateTime(utcNow(), 'yyyy-MM-dd')

 

 

The “Condition ” is used to compare the due data with the date now. The due data and the date now could be format to a same type.

When an item is create,the flow run successfully as below:

 

 5.png

 

I hope my clarification has been helpful. 

Please feel free to contact us if you have any other questions.


Regards,
Alice Zhang

View solution in original post

6 REPLIES 6
Community Support
Community Support

Re: Is there an expression in Flow like =TODAY() in Excel that gives today's date as output?

Hi @ AVH,

Thank you for posting.

What is format of “Due Data” in your column?

You could add a “Compose” action and take a try to use expression below:

Expression:

formatDateTime(utcNow(),'yyyy-MM-dd')

Use this Expression would return a data like 2018-01-24

 

 

Image reference:

 1.jpg

 

2.png

 

 

More details about the Workflow Definition Language, please check the link below:

https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language

 

 

I have a sharepoint list and the list have a Date type due data field.

 3.png

I have made a flow to compare the due data with the date now. please refer to screenshots below:

4.png

 

The expression of first value as below:

formatDateTime(triggerBody()?['duedate'],'yyyy-MM-dd')

 

The expression of second value as below:

formatDateTime(utcNow(), 'yyyy-MM-dd')

 

 

The “Condition ” is used to compare the due data with the date now. The due data and the date now could be format to a same type.

When an item is create,the flow run successfully as below:

 

 5.png

 

I hope my clarification has been helpful. 

Please feel free to contact us if you have any other questions.


Regards,
Alice Zhang

View solution in original post

AVH Advocate I
Advocate I

Re: Is there an expression in Flow like =TODAY() in Excel that gives today's date as output?

@v-yuazh-msft,

 

Got it!

 

Thank you very much for your input!

SSafeAdmin
New Member

Re: Is there an expression in Flow like =TODAY() in Excel that gives today's date as output?

Hi there!

Thanks for your explanation - the easiest one I have found so far on this!

What if I wanted to the action to occur if the duedate value was today-30 days?  

 

Thanks so much

Shannon

mleon
Regular Visitor

Re: Is there an expression in Flow like =TODAY() in Excel that gives today's date as output?

here you go 🙂
 
formatDateTime(addDays(utcNow(), -30), 'MM/dd/yyyy')
ClaireAllen Helper I
Helper I

Re: Is there an expression in Flow like =TODAY() in Excel that gives today's date as output?

Hello @v-yuazh-msft ,

 

I have a similar question,

 

I am creating a workflow where I have a document Library and when a document is modified I want a workflow to run on a calculated column which is =modified+365

 

I've tried the solutions mentioned, but my workflow did not work (I did changed the date to only 2 days for testing purpose)

 

I have a condition in the workflow, see image

msworkflow.JPG

 

Would you be able to advise where I went wrong,

 

Thank you

 

Claire Allen

temoneyn
New Member

Re: Is there an expression in Flow like =TODAY() in Excel that gives today's date as output?

How can I have the date to come out the correct way MM.DD.YYYY as this formula is displaying the date YYYY.MM.DD, no matter how the expression is entered. This is the expression I have entered in my flow.

formatDateTime(utcNow(),'MM-dd-yyyy') 

 
 

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (7,075)