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 / ODATA Filter Query: Da...
Power Automate
Unanswered

ODATA Filter Query: Date of Outlook Event trigger

(0) ShareShare
ReportReport
Posted on by 100

Hello community,

in my flow I want get/load all calender events with the same date as the date as my trigger event.

In the first step, I think, I need to extract the date from the dynamic content "datetime" of trigger event. Within a compose I would do something like 

 

 

 

formatDateTime(triggerOutputs()?['body/start'],'dd/mm/yyyy')

 

 

 

 
is that correct? In the next I need to filter via ODATA. I dont now what to type in the field "Filter Query" within "Get events (V4)". Can you help me? I thought about something like 

 

 

 

start Time "Dynamic content of my compose with extracted date"

 

 

 

 

Thank you for any ideas!

Categories:
I have the same question (0)
  • Sundeep_Malik Profile Picture
    6,484 on at

    Hey @ultrAslan 

     

    Looks fine to me currently. 

     

    Some changes to make:

     

    formatDateTime(triggerOutputs()?['body/start'],'dd/mm/yyyy')

     

    The month above is wrong.

    Small mm represent minutes in Power Automate.

    Capital MM represent Months.

     

    So, write it like:

     

    formatDateTime(triggerOutputs()?['body/start'],'dd/MM/yyyy')

     

    Then in filter query the dynamic expression should be surrounded by single quotes instead of double quotes. 

     

    start Time 'Dynamic content of my compose with extracted date'

     

    and maybe, not sure but 

     

    start Time above should be without space.

     

    startTime 'Dynamic content of my compose with extracted date'

     

     

    Rest everything looks correct. I was not able to understand your question completely, but these were the mistakes I saw, and pointed out.

     

     

  • ultrAslan Profile Picture
    100 on at

    Thank you.
    In the filter query I typed in

    startTime eq '@{outputs('Compose')}'

     

    with that error result:

    Could not find a property named 'startTime' on type 'microsoft.graph.event'   .

    I guess the command the was wrong. 

     

  • Sundeep_Malik Profile Picture
    6,484 on at

    @ultrAslan 

     

    My bad, its Start time not not startTime.

     

    Try this now:

    Start time eq '@{outputs('Compose')}'

     

    Sundeep_Malik_0-1669113156861.png

     

    But then if you format the time coming from email. The filter query will give 0 items. 

     

    1) Try without formatting.

    2) If 1st method does not work, skip filter query in Get Events. After get events action, take a condition action.

    In that format the Start time coming from get events and match it to the formatted date from email. 

     

    Actually if you format the date coming from email, then the start time date and time will not match everytime. 

    This is because the start time is giving in this format: dd/MM/yyyy T hh:mm:ssZ

    So, they will never match.

  • ultrAslan Profile Picture
    100 on at

    I have given very few details.I am interested in all other Outlook events that take place on the same day as the trigger event - regardless of the time, of course. I'm afraid that if I don't format this, it won't return any results as you say, because the time is in there and therefore it can't match (because the other events have different times).

    I'll try to do that anyway now according to your suggestions. 

    Thank you.

  • grantjenkins Profile Picture
    11,063 Moderator on at

    The Start Time internal field name is just start. To retrieve it from your trigger you would use the following expression:

     

    triggerOutputs()?['body/start']

     

     

    Since your events also contain the time, you can't just use date formatting to get what you want. Instead, you can get the start of today and start of tomorrow then return items between those times. In my example, I'm assuming your trigger is When a new event is created.

     

    See full flow below. I'll go into each of the actions.

    grantjenkins_0-1669118162135.png

     

    The trigger will get the event that was just created.

    grantjenkins_1-1669118191350.png

     

    I then have two Compose actions that I've named Today and Tomorrow. They use the following expressions.

     

    //Start of today
    startOfDay(triggerOutputs()?['body/start'])
    
    //Start of tomorrow using addDays and adding 1 day.
    startOfDay(addDays(triggerOutputs()?['body/start'], 1))

     

    grantjenkins_2-1669118299429.png

     

    Get events uses the following Filter Query. Note the single quotes around the dynamic dates.

     

    Updated: Also note that we can't just use start here - we need to put start/DateTime for Outlook Events.

     

    start/DateTime ge '@{outputs('Today')}' and start/DateTime lt '@{outputs('Tomorrow')}'

     

    grantjenkins_1-1669123243117.png

     

  • ultrAslan Profile Picture
    100 on at

    Thank you for this very structured answer. I could follow your explanations very well.


    Exactly, my trigger event is "When a new event is created (V4)".

    I used exactly the same namings when adapting your suggestion. For me it is all very conclusive,
    Unfortunately the error message "Invalid filter clause" appears.

    I will search for the error and try to fix it but keep your structure for the most part.
    Thanks for your help!

  • grantjenkins Profile Picture
    11,063 Moderator on at

    I generally always test my flows, but this one I didn't 🙁

     

    Looking at it now to see what the issue is.

  • Verified answer
    grantjenkins Profile Picture
    11,063 Moderator on at

    @ultrAslan Found the issue. Really strange that we need to add start/DateTime in the Filter Query. So, the expression would be:

    start/DateTime ge '@{outputs('Today')}' and start/DateTime lt '@{outputs('Tomorrow')}'

    grantjenkins_0-1669123034761.png

     

    I'll update the original post to show the correct filter too.

  • KS-ITSupport Profile Picture
    3 on at

    Made an account just to say thank you for this - I'd been banging my head against the wall trying to figure out why "Start" wasn't working 🙂

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 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard