cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FKarluk
Frequent Visitor

Monthly List Filter Array

I need assistance with updating a Filter Array to only pull the last months worth of list items. For example, if a list item was created in October, i need the filter array to display all items created for that month at the end of the month.

Here is what i have now. This will send at 12:03 pm est for the last 5 business days. I need it to send on the first day of the new month, all items created for the previous month. How could i accomplish that?

 
 

This link did not help, https://powerusers.microsoft.com/t5/Building-Flows/Monthly-email-with-info-about-new-items-in-SP-lis...as suggested on my previous post. What this did was include the last 31 days, which would also include today. When i ran this flow, it pulled results from today. I need the results to only show items created or given in the List from the previous month. 

6 REPLIES 6
FKarluk
Frequent Visitor

FKarluk_0-1635791398464.png

 

Paulie78
Super User
Super User

Check out this video I did which shows a way to filter by Month:

How to easily filter a SharePoint list by Day, Month or Year with hidden oData filter functions 

Thanks Paulie. After watching this video, i see what you needed done. What i need done, is to only show the previous month, regardless of day, month or year. For example, last month, October 2021, my company sent 15 requests which generated 15 list items in sharepoint. Today, Nov 1st, 2021, i want a email sent with the list items only for the previous month, not to include September or November. Today, we already had 1 item created. My current query, shown in comments, shows last 31days, which would include today. That cant be. How could i accomplish this? If done correctly, it would show 15 results, not 16, for today. 

The goal is to have this flow send the email, each month, without any intervention. It needs to know what the current month is, what the previous month was, and send out the email with all list items from the previous month only. 

Hi @FKarluk 

You can take a try with the screenshots below to get the first day of the previous month and the last day of the previous month, then filter out items whose date is the previous month.

Get last day of the previous month:

Expression:subtractFromTime(startOfMonth(utcNow()),1,'day','yyyy-MM-dd')

vLilyWmsft_2-1635820571143.png

Get the first day of the previous month:

Expression:startOfMonth(outputs('Compose'),'yyyy-MM-dd')

vLilyWmsft_3-1635820583185.png

vLilyWmsft_4-1635821098923.png

vLilyWmsft_6-1635821297832.png

vLilyWmsft_7-1635821339447.png

Hope the content above may help you.

Best Regards

Yes, so the values you would supply to the action are the current month minus one, and the current year. That will give you back every entry from the previous month. If you watch until the end of the video, I demonstrate how to do exactly what you want.

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.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (3,601)