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 / Correct Filter Query f...
Power Automate
Answered

Correct Filter Query for SharePoint Get Items where I need to find the previous event date

(0) ShareShare
ReportReport
Posted on by 65

Hi All,

Please help me to find the correct filter to be applied in get items, if I want the previous details of event occurred in SharePoint calendar. For eg: if schedule some event today in my SharePoint calendar i want the details of previous event  which occurred on some days ago. I am using this filter query in get item it is showing error. Basically i am thinking to use getItem , to put the calendar list name , and to use filter query to fetch the latest event details whose start date is less than the current event start date Anybody have idea.

 

Capture1234.PNG

Categories:
I have the same question (0)
  • priya93 Profile Picture
    65 on at

    Hi All,
    If anybody knows the solution can you please help me as it is very urgent.

    Thanks and Regards,

  • JohnAageAnderse Profile Picture
    1,986 on at

    Hello Priya93

    I see some issue that needs to be corrected:

    1. The column name "Start Time" - you have to use the column's internal name. No spaces are allowed in column names the Filter Query field.
    2. The Order By field also must use the column's internal name.
    3. The Order By field used "asc" for ascending and "desc" for descending, so change your "dsc" to "desc".

    Hope this helps you on the way 🙂

    John

  • ScottShearer Profile Picture
    25,290 Most Valuable Professional on at

    @priya93 

    Can you provide some more details on what you mean by previous event? How can it be identified?

     

     

  • JohnAageAnderse Profile Picture
    1,986 on at

    Hello ScottShearer

    The screenshot says it all - get the top event that has a start time less than or equal to the variable Start Date, order by start time in descending order.

     

    That will get the previous event (or at least one of them).

    Kind regards, John

  • Verified answer
    ScottShearer Profile Picture
    25,290 Most Valuable Professional on at

    @JohnAageAnderse 

    See my screen shot below - EventDate is the internal name for start date in a standard SP calendar.

    While the screen shot will directly answer your question, I don't believe that this will work for you if you have repeating events in the calendar due to how SharePoint stores the data.

    FlowCal1.png

     

  • JohnAageAnderse Profile Picture
    1,986 on at

    Hello @ScottShearer 

    Thank you for the correction of my understanding 🙂 Now we just have to wait for @priya93  to report back on whether or not the issue has been resolved. It could work if they are not using recurring events.

    Kind regards, John

  • priya93 Profile Picture
    65 on at

    Hi ,
    Thanks for replying. Now my flow is working fine. But unable to get the desired data attached is the screenshot
    Capture456.PNG

  • priya93 Profile Picture
    65 on at

    Hi  @ScottShearer  & @JohnAageAnderse 

    As in the last post p/422028#M341https://powerusers.microsoft.com/t5/Help-with-the-Forum/Correct-Filter-Query-for-SharePoint-Get-Items-where-I-need-to/m-p/422028#M341 , my flow is working fine but unable to get the desired result i want. For eg: i have scheduled meeting on sharepoint calendar on today, i want the details of previous meeting details which was scheduled before this meeting eg: 18th dec.

  • JohnAageAnderse Profile Picture
    1,986 on at

    Hello @priya93 

    Please provide more information about your steps - can't see what you are trying to do!

    Is the list you are getting items from a calendar?

    How does the Filter Query field look like and what is the actual value you are using in the field?

    Do you or the account that runs the flow have permissions to read from the calendar?

    I just tried doing what you are trying and it works for me! No recurring meetings though in my calendar 🙂

    Kind regards, John

  • priya93 Profile Picture
    65 on at

    Hi @JohnAageAnderse ,
    Thanks for replying. I have added answers .

    Is the list you are getting items from a calendar? - Yes

    How does the Filter Query field look like and what is the actual value you are using in the field?- 
    The filter query i am using the same in screenshot above EventDate le '@{variables('start date')}', T have stored the start date of meeting in a variable named startdate. i am trying to fetch the last event whose start date is less than current event date, so that i want to fetch the details of last event , store it  update the  current event fields with last event details.
    Do you or the account that runs the flow have permissions to read from the calendar?- Yes, i am sharepoint admin and flow i think it have permision, don't know exactly how to check that whether my flows that permission or not. but when i run the above workflow it was working fine, but not getting the desired result

    I just tried doing what you are trying and it works for me! No recurring meetings though in my calendar? Can u please share the screenshots.

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 612

#2
Valantis Profile Picture

Valantis 344

#3
11manish Profile Picture

11manish 326

Last 30 days Overall leaderboard