web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Sharepoint list get pr...
Power Automate
Unanswered

Sharepoint list get previous month of data

(0) ShareShare
ReportReport
Posted on by 33

Hi

 

I am trying to create a flow that will extract the last months worth of data from a Sharepoint list and put it into a excel spreadsheet. The month worth of data could be at any point so using the start or end of a month is not an option.

 

I have managed to get the data out but I am struggling with filtering down to just the last months worth.

 

So far I have the following:

SMCApps_2-1684504933596.png

SMCApps_3-1684504976036.png

 

Thank you for any help.

 

SMCApps

 

 

Categories:
I have the same question (0)
  • ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at

    Hi @SMCApps 

     

    To filter out last 30 days items you can make use of below filter query in 'Get items' action:

    Created ge '@{formatDateTime(addDays(utcNow(),-30),'yyyy-MM-ddT00:00Z')}'

    ManishSolanki_0-1684507177432.png

     

    If this helps, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

     

  • PA-15051058-0 Profile Picture
    33 on at

    @ManishSolanki 

     

    Thank you for this, I have tried and got the following error:

    SMCApps_0-1684745893481.pngSMCApps_1-1684745905309.png

    Any ideas?

     

    Not sure if it effects anything, but we use UK date format, I adjusted the date layout in your formula and still got the same error. I also tried using '/' rather than '-' and got the same error.

    SMCApps_2-1684746052490.png

     

     

    Thank you for your help

    SMCApps

     

  • ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at

    Hi @SMCApps 

     

    You have missed to wrap formatDateTime formula in single quotes. Pls use the below expression, just paste it inside the filter query of 'Get items' action:

    Created ge '@{formatDateTime(addDays(utcNow(),-30),'yyyy-MM-ddT00:00Z')}'

     

    If this helps, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

  • PA-15051058-0 Profile Picture
    33 on at

    Hi @ManishSolanki 

     

    Thank you this has worked, however this only does the past 30 days, I need the past month.

     

    For example, if this is run on the 16th of a month it should pull data from the 16th of the previous month, this is not always 30 days difference. Is there a way of doing this?

     

    Thank you

    SMCApps

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard