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 / Retrieving Events from...
Power Automate
Answered

Retrieving Events from a Group calendar

(0) ShareShare
ReportReport
Posted on by 12
My end-goal is to retrieve a list of events on our group calendar every Monday. This list of events would include any in the time of "Current Time" to "7 Days in the Future". I have been able to successfully test a flow that has a recurrence, current time, get future time, and Send an HTTP request V2; however, I cannot get past this point. Copilot hasn't been very helpful.
Categories:
I have the same question (0)
  • Suggested answer
    David_MA Profile Picture
    12,982 Super User 2025 Season 2 on at
    I do it this way:
    1. Trigger scheduled flow as you outline in your post.
    2. Use two compose actions to create the dates for the start and end time frame.
      1. Start expression: startOfDay(utcNow(),'yyyy-MM-dd')
        1. Compose action named Compose Start
      2. End expression: addDays(startOfDay(utcNow()),31,'yyyy-MM-dd')
        1. Update 31 to 7 or your desired timeframe.
        2. Compose action named Compose End
    3. Send an HTTP request to the Graph API using the Groups HTTPs action.
      1. Use this in the URI: https://graph.microsoft.com/v1.0/users/emailaddressofcalendar@company.com/calendar/events?$filter=(start/dateTime ge '@{outputs('Compose_Start')}T00:00:00' AND start/dateTime lt '@{outputs('Compose_End')}T00:00:00')&$orderby=start/dateTime
      2. Update the highlighted portion to the e-mail address of the group calendar.
    4. Add a parse JSON action so you can get the values from the HTTP request. I have attached the scheme to a text file. If this doesn't work, you'll need to generate the scheme from sample data.
    5. Add a condition to see if there were any events found.
      1. Use this expression on the left side of the condition: length(body('Parse_JSON')?['value'])
      2. Set the logic to is greater than 0
    6. Add a Select action on the yes side of the condition and use the body value from the Parse JSON action.
      1. I then map it this way, but you can set it up to meet your needs:
    7. Add a Create HTML table action from the output of the select action.
    8. To e-mail this, put the e-mail action into HTML mode and use this expression to insert the table into the e-mail: replace(replace(replace(body('Create_HTML_table'),'&lt;','<'),'&gt;','>'),'&quot;','"')
      1. You may need to add some custom CSS to format the table depending on your needs.
    Your flow will look like this:
    The crossed-out actions are specific to my process.
     
  • LJ-20021816-0 Profile Picture
    12 on at
    Thank you, David! I followed your steps, but ran into this error message at the "Send an HTTP request V2" step:
     
    "Invalid filter clause: A binary operator with incompatible types was detected. Found operand types 'Edm.String' and 'Edm.Date' for operator kind 'GreaterThanOrEqual'."
     
    This was the input of my expression (calendar ID hidden for privacy):
    https://graph.microsoft.com/v1.0/groups/calendar ID/calendar/events?$filter=(start/dateTime ge 2025-02-20 AND start/dateTime lt 2025-02-27)&$orderby=start/dateTime
     
    This is the URI:
    https://graph.microsoft.com/v1.0/groups/calendar ID/calendar/events?$filter=(start/dateTime ge @{outputs('Compose_Start')} AND start/dateTime lt @{outputs('Compose_End')})&$orderby=start/dateTime
     
    What did I miss?
  • Verified answer
    David_MA Profile Picture
    12,982 Super User 2025 Season 2 on at
    Look closely at the URI in my post:
     
    https://graph.microsoft.com/v1.0/users/emailaddressofcalendar@company.com/calendar/events?$filter=(start/dateTime ge '@{outputs('Compose_Start')}T00:00:00' AND start/dateTime lt '@{outputs('Compose_End')}T00:00:00')&$orderby=start/dateTime
     
    The filter values are in single quotes and you are missing the time portion. This is important and they appear to be missing based on your post. If you still have trouble after adjusting for this, you'll need to include screen shots of how you configured your actions as that is the only way I can see what you may have done incorrectly. 
     
    If you configure the two compose actions as I listed below with the same names, you should be able to copy and paste my expressions into Power Automate and avoid this problem.
  • LJ-20021816-0 Profile Picture
    12 on at
    That fixed it! Now, for the "If Yes" section. It will let me add the Select feature, but as soon as I put the Body of the ParseJSON into the From field, it moves it to an "Apply to Each". Is that a problem?
     
     
    The tests are successful, but it isn't pulling in any events (when I know there should be at least 1 in the next 7 days). On my Condition New Events Found step, this is my expression. The results from the test say that it is false.
     
     
    Thank you so much for all of your help! This has been a lifesaver. I've struggled with this project off and on for almost 3 months.
  • David_MA Profile Picture
    12,982 Super User 2025 Season 2 on at
    Delete the apply to each action and note the value used in the Parse JSON action in the apply to each. You want to put that value (Body) into the select action and not value.
  • LJ-20021816-0 Profile Picture
    12 on at
    I thought a screen recording might help. What am I missing?

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

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard