cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rth49
Level: Powered On

Condition using Date field

I have a field(column) in my SharePoint Library that uses the Modified date and adds 365 days to it.  I want to use flow to send an email on that future date to the file owner.  Does it look at that field as a date?  I was hoping to use a condition, but can't figure it out.

7 REPLIES 7
Highlighted
sharonsumner
Level: Powered On

Re: Condition using Date field

Hey

 

I would do the calcluation in Flow rather than try to get your field to behave as a date (assuiming you are using a calculated column) . Your formula is static so on edit get flowto run and to work this out and write the value back to a date field - and then use this value to do the remaining flow work. 

 

Sharon

Super User
Super User

Re: Condition using Date field

@rth49 

I have provided an example below that may help you.

I am using a recurrence trigger so that the Flow runs once a day. You should verify that you have selected Date/Time for the type of data in the column settings for the calculated column.

I am assuming that you are using a calculated column for the modified date plus 365 - my column is called DateCalc.

I am using two expressions in my trigger - they can also be seen in the comments area.

Also, by default, Get items only returns 100 records.  If you will have over 100 records, go to the settings page for the Get Items action ans configure per the screen shot below - you can retrieve up to 5000 items with a standard Flow license.

DateCalc.jpgDateCalc1.jpgDateCalc2.jpg

 

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
rth49
Level: Powered On

Re: Condition using Date field

Thanks Scott, enjoyed your session at the Flow Conference Tuesday!

 

The flow ran using your condition, but I don't think I understood what it was supposed to do.  Is the condition you sent me just converting the Calculated date to a date?  I think what confused me was in the addDays formula it added 1 day.  I changed that to 365, but think I should have changed the middle drop down to something else.  It sent out emails for any dates grater than or equal to today and less than 365 days ahead.  We have 4,000 items so it was sending emails to everyone that owned an item.  I don't want it to send an email until 365 days from the modified date.   Do I create another action?

 

I apologize for my ignorance.  I am new to Microsoft Flow.

Super User
Super User

Re: Condition using Date field

@rth49 

In your original post you said the following:

"I have a field(column) in my SharePoint Library that uses the Modified date and adds 365 days to it. "

This implies that you have a calculated column in your SharePoint list.  

Do you have a calculated column in your SharePoint list that adds 365 days to the Modified date?

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
rth49
Level: Powered On

Re: Condition using Date field

Yes.   I have a calculated column in our SharePoint list that I was trying to use in the condition.  It is a column named Revalidated Date that adds 365 days to the Modified date.  I was trying to use the Revalidated Date from the Dynamic content list.

Super User
Super User

Re: Condition using Date field

@rth49 

I am working from the assumption that the Revalidated Date column contains a value that is 365 days from the last modified date.

So, a calculated date column includes not only a date but a time as well.  So my conditions account for the time component by saying that the date/time must be greater than the start of today and less than tomorrow (thats why I add 1 day).

In my expressions, I refer to utcNow() which give you the current date and time

I also use formatDateTime wich just formats an existing date (utcNow())

Where I reference DateCalc, you should reference you calculated date/time column (Revalidated Date)

Finally I use addDays() which can add or subtract a number of days from an existing date and format the output as well.

 

There is another way to go about this but it would require you to manually enter a reference to you column without simply picking it from Dynamic properties as you can in my example.

 

The bottom line is this: Get items will only return items where the calculated date column is today.

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
rth49
Level: Powered On

Re: Condition using Date field

Sharon,

 

Is you suggestion different than what Scott put together below?  How do I do a calculation in Flow to figure this?  Like I said to Scott, I am very new to Flow.

 

Thanks

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons in April

Read the announcement for more information!

firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

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
Top Kudoed Authors
Users online (4,704)