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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Get last or previous m...
Power Automate
Answered

Get last or previous month SharePoint list items

(0) ShareShare
ReportReport
Posted on by 1,121

Hello Power Addicts,

I am trying to get all SharePoint list items whose "MyDate" column is having any date of previous month. I am using below filter query in Get Items action.

 

MyDate ge '@{startOfMonth(getPastTime(1,'Month'))}' and MyDate lt '@{startOfMonth(utcNow())}'

 

I dont know why but I dont get items dated 1st of previous month and I also get items dated 1st of current month. Both these cases shouldn't happen. My SharePoint site is in IST time zone. Should that be a problem as flow can understand only UTC. How should my filter query look like?

 

Thanks,

Ramesh

Categories:
I have the same question (0)
  • Verified answer
    rameshmukka Profile Picture
    1,121 on at

    Below expression solved the problem

    MyDate ge 'formatDateTime(startOfMonth(getPastTime(1,'Month')),'MM-dd-yyyy')' and MyDate lt 'formatDateTime(startOfMonth(utcNow()),'MM-dd-yyyy')'
  • tom_riha Profile Picture
    10,187 Most Valuable Professional on at

    Hello @RameshMukka ,

    I suppose the timezone could be the problem, the difference of 5 hours and 30 minutes could move the date to another day. You could try to convert the output from getPastTime(...) and utcNow(...) into the IST time zone with the convertFromUtc(...) expression:

    e.g.
    convertFromUtc(utcNow(),'India Standard Time')
    
    MyDate ge '@{convertFromUtc(startOfMonth(getPastTime(1,'Month')),'India Standard Time')}' and MyDate lt '@{convertFromUtc(startOfMonth(utcNow()),'India Standard Time')}'
    

     

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 251 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 239

#3
Expiscornovus Profile Picture

Expiscornovus 220 Most Valuable Professional

Last 30 days Overall leaderboard