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 / Get last or previous m...
Power Automate
Answered

Get last or previous month SharePoint list items

(0) ShareShare
ReportReport
Posted on by 1,115

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)
  • tom_riha Profile Picture
    10,185 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')}'
    

     

     

  • Verified answer
    rameshmukka Profile Picture
    1,115 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')'

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
David_MA Profile Picture

David_MA 258 Super User 2025 Season 2

#2
trice602 Profile Picture

trice602 205 Super User 2025 Season 2

#3
Expiscornovus Profile Picture

Expiscornovus 204 Most Valuable Professional

Last 30 days Overall leaderboard