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

Scheduled flow: Show item information in email depending on their date column

Hi.

 

I have been tasked with making a scheduled flow. This flow will run each day at 9am.

 

I have a sharepoint list, with a column called 'Review date'. I want to make it so that the email reminder will include all items with a review date within the next 5 days. 

 

For example, we have 3 items, one with an RD on the 31st March, two with an RD on the 1st April, and three with an RD on the 2nd April.

 

If the flow were to run today, it'll show; Item 1: Name, ID, review date, Link. (Same for item 2 and 3).   

 

Is a scheduled flow like this possible? 

 

Thank you for your help in advance. 

1 ACCEPTED SOLUTION

Accepted Solutions
ScottShearer
Super User III
Super User III

@Alfie_Smith 

You should use a Recurrence trigger and configure it to run at 9:00 AM each day.

To retrieve only items that have a review date within 5 days, you'll want to use a Filter Query - click on "Show advanced options" to see the Filter query text box.

Your filter query should look something like this:

ReviewDate1.jpg

 

Please note that ReviewDate is the internal name of the Review Date column - your internal name might be different.

Additional info on OData filter queries can be found here.

 

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

Scott

View solution in original post

6 REPLIES 6
ScottShearer
Super User III
Super User III

@Alfie_Smith 

You should use a Recurrence trigger and configure it to run at 9:00 AM each day.

To retrieve only items that have a review date within 5 days, you'll want to use a Filter Query - click on "Show advanced options" to see the Filter query text box.

Your filter query should look something like this:

ReviewDate1.jpg

 

Please note that ReviewDate is the internal name of the Review Date column - your internal name might be different.

Additional info on OData filter queries can be found here.

 

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

Scott

View solution in original post

Thank you!

 

It works well, but I noticed that items with a review date that is today (e.g. 1st April) aren't included, only items in the next 5 days. Is there a way to adjust the code to include items on the day?

Ah no worries, I figured it out!

 

For those wondering, in the filter query, replace 'gt' with 'ge'.

 

Use this website here for reference on filter queries: https://diyd365.com/2019/11/20/every-power-automate-ms-flow-filter-query-you-ever-wanted-to-know-as-...

 

The site connection says it is not secure however, so enter at your own risk. 

@Alfie_Smith 

Good catch!

Also, here is a link to a really good explanation of using OData filters with SharePoint lists (including the use of gt, ge, lt, eq, etc.)

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 for all the help.

 

I've just been in a call regarding this flow, and they wondered if its possible to get retrieve these items ordered by date? 

I currently take the data from the filter, and place them into a html table. The html table is inserted into an email and sent to all appropriate users. 

 

examplescheduledflow.PNG

@Alfie_Smith 

To retrieve the items by date, use the Order By  feature in the Get items action - see my example above.

Your order by expression miight look something like this:

MyDate asc or MyDate desc

Where MyDate is the internal name of the date column

Also, please note that the Get items action returns only 100 items by default - to change this go to settings for the action, turn on pagination and enter a number of up to 5000 (in most cases).

 

 

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

Scott

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,627)