3 Ways to Get Calendar ID in Power Automate

Do you need to use a personal or group calendar ID in your flow?

Unfortunately, you can’t find these IDs within the Outlook Calendar URL like you can with other Microsoft tools such as with finding a Microsoft Form ID.

Getting the Calendar ID in Power Automate can be a tricky task. However, it is an essential step when you want to automate your calendar related tasks.

The Calendar ID is a unique identifier that is used to identify a specific calendar in your Microsoft account. Without it, you won’t be able to perform any actions related to that calendar.

Fortunately, there are several ways to get either a personal calendar ID or a group calendar ID in Power Automate.

This post will show you all the ways you can find these elusive calendar IDs in your flow.

Get the Calendar ID with the Outlook Get Calendars Action

To get the calendar ID in Power Automate, you can use the Outlook Get calendars action. This action allows you to retrieve a list of all the calendars that are available to the authenticated user.

Here are the steps to follow.

  1. Add the Get calendars action from the Office 365 Outlook connector to your flow. This action requires no additional information and will return all your personal calendars when it is run.
  2. After the Get calendars action, you will be able to use the value ID and value Name dynamic content.

The output of the Get calendars action includes an array of calendars, each with a set of properties that describe the calendar.

These include the value Name which is the name that’s displayed in Outlook and the value ID which is the calendar ID.

@{outputs('Get_calendars_(V2)')?['body/value'][0]['id']}

For example, to retrieve the first calendar ID from the output, you can use the above expression. This expression retrieves the ID of the first calendar in the array.

If you want to retrieve the ID of a different calendar, you can change the index [0] in the expression accordingly. For example, [1] will return the second calendar ID.

Once you have retrieved the calendar ID, you can use it in other actions that require the calendar ID.

Get the Calendar ID with Peek Code

Another way to get the calendar ID is by using the peak code feature in certain actions.

You can use the Get calendar view of events action from the Office 365 Outlook connector.

This action allows you to select the calendar from which to return a list of events by using a dropdown list.

In the user interface, you will see the calendar display name, but behind the scenes it will use the calendar ID. You can then use Peek Code feature to see this ID.

Here are the steps to follow to get the calendar ID with the peek code feature.

  1. Add the Get calendar view of events action from the Office 365 Outlook connector to your flow.
  2. Select the calendar in the Calendar Id dropdown list. This will show all your personal calendars.

There is no need to fill in the other required fields for this action since it is only being temporarily used to get the ID.

  • Click on the Ellipses icon in the right of the Get calendar view of events action.
  • Select the Peek code option from the menu.

This will open up the peek code view for the action and you will be able to see the selected Calendar Id among other information for the action. You can see this as the calendarId key.

You can copy this to your clipboard to use later and then click on the Done button to close the peek view mode.

Get Group Calendar ID with the Office 365 Groups HTTP Request Action

Unfortunately, group calendars don’t show up in the Office 365 Outlook connector.

This will all appear in the Office 365 Groups connector.

To get the calendar ID of a group in Power Automate, you can use the Send an HTTP request action in the Office 365 Groups connector. This action allows you to make an HTTP request to the Microsoft Graph API and retrieve the calendar ID of the group.

Follow these steps to use the Send an HTTP request action to get the calendar ID.

  1. Add the Send an HTTP request action from the Office 365 Groups connector to your flow.
  2. Set the URI as https://graph.microsoft.com/v1.0/groups. This will return all the groups in your tenant along with the group ID, this will also be the calendar ID.
  3. Set the Method to GET.

Once you have provided this information, you can use the HTTP request action to retrieve the calendar ID of the group.

The displayName key will be the name seen in Outlook and the id key will be the calendar ID.

When the HTTP request is executed, it will return a JSON object containing the ID of the group. You can then use this as the calendar ID to retrieve the events from the group calendar using the same Send an HTTP request action from the Office 365 Groups connector.

GET https://graph.microsoft.com/v1.0/groups/{group-id}/events

For example, the above request will return events from the group calendar with ID {group-id}. The {group-id} parameter should be replaced with the ID of the group whose calendar you want to retrieve.

📝 Note: You will be able to list all groups, but you will only be able to list events from a group that you have access to.

Conclusions

Getting the calendar ID in Power Automate can be a bit tricky, but it is definitely possible.

The method you use will depend on the type of calendar you are trying to access, whether it is a personal calendar or a group calendar.

If you are trying to access a personal calendar, you can use the Get calendars action to retrieve the calendar ID. This action will return a list of all the calendars associated with the specified account. You can also get a single ID quickly with the peek code feature in some actions.

If you are trying to access a group calendar, you will need to use the Microsoft Graph API to retrieve the calendar ID. This can be done by sending a GET request using the Send an HTTP request action in the Office 365 Groups connector.

Have you needed the calendar ID in your flow to get calendar events? How did you find this? Let me know in the comments!

About the Author

John MacDougall

John MacDougall

John is a Microsoft MVP and freelance consultant and trainer specializing in Excel, Power BI, Power Automate, Power Apps and SharePoint. You can find other interesting articles from John on his blog or YouTube channel.

Related Articles

Comments

3 Comments

  1. Rodrigo

    Hi John! Very helpful this post of yours.

    Please, lets say the workflow is returning three calendars and their respective IDs. Is it possible to have a filter in the workflow to retrieve only the ID of the main calendar (name = Calendar)?

    Reply
  2. Donovan

    Thank you! Exactly what I needed.

    Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Get the Latest Tech Tips

Write For Us

Are you a tech enthusiast with a talent for writing great content? Come write for us!

Follow Us

Follow us on social media to stay up to date with the latest in tech!