cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rth49
Helper I
Helper I

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

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

ScottShearer
Super User
Super User

@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

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.

@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

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.

@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

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
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (5,092)