cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Globier
Advocate I
Advocate I

Easiuest way to get calendar_id for the Office 365 Calendar connector

Hi Guys,

    I'm just starting to trial flow to trigger from some calendar events in an Office365 shared calendar.  

 

What is the easiest way to get the calendar ID of the shared calendar?

58 REPLIES 58
Anonymous
Not applicable

Hi,

 

You can use Microsoft Graph to get the calendar ID:

 

https://developer.microsoft.com/en-us/graph/graph-explorer#

 

I used this command to get the calendar ID of an Office 365 group:

Get Beta https://graph.microsoft.com/beta/groups/[group object id]/calendar

 

More info at: https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/api/calendar_get 

 

I was able to use the graph to get the calendar ID of one of my resource calendars, however; it doesn't seem to work.  I'm using the trigger "When a new event is created."  I tried both the V1 and the V2 versions, but both fail to recognize when a new event is created on the resource calendar.  

 

Am I doing something wrong here or is this just not a supported feature?

efialttes
Community Champion
Community Champion

In case you are dealing with Office 365 GRoups Calendar, there is an Office 365 GRoups connector in PReview, the only trigger currently available is "When there is a new event" an you can see on the drop down menu all the GRoup Ids you are member of.

 

Office365GRoups_trigger.png

There is also a Create group event action block.

Hope this helps

Did I make your day? If so, mark my response as 'Solution' !!!

También escribo sobre Power Automate en este Blog y en Twitter

sogravesDK
Regular Visitor

Hi all.

I haven't solved this, but I came a long way though.

 

I did a "Get Calendars"  --> For Each , input [Value] --> by default all calendars in my organization is named "Calendar", so in the 'For Each' I did a 'Condition' and asked [DisplayName] from Get-Calendar contains 'Calendar' - then create event and CalendarID is 'Name' from Get-Calendars...

 

 

thanks for posting this - very helpful. I reapplied it. You should get credit for creating a solution!

DayByDay
New Member

Use Powershell to invoke Rest API:

PS C:\> $cred = Get-Credential

PS C:\> Invoke-RestMethod -Uri "https://outlook.office365.com/api/v1.0/users/{UPN}/Calendars" -Credential $cred | ForEach-Object {$_.Value} | fl

 

Replace {UPN} with mailbox UPN.

 

Inspired by:

https://lazywinadmin.github.io/2015/06/powershell-using-office-365-rest-api-to.html

 

 

I'm able to get the ID information if I populate the UPN value with my email address or use "me".  However, if I try any other email value I get an error that looks like this.

Invoke-RestMethod : The remote server returned an error: (404) Not Found.
At line:1 char:1
+ Invoke-RestMethod -Uri "https://outlook.office365.com/api/v1.0/users/ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

 

Also how would I specify a Resource Calendar name for the UPN?  Their typically isn't a visible email associated with a resource.  I've tried using the name of the resource but it returned the same error.

You HAVE solvde this, at least for me - in fact you saved my life! Many thanks for a simple but effective solution.

Anonymous
Not applicable

I was able to get it working with the suggested Powershell method:

Use Powershell to invoke Rest API:

PS C:\> $cred = Get-Credential

PS C:\> Invoke-RestMethod -Uri "https://outlook.office365.com/api/v1.0/users/{UPN}/Calendars" -Credential $cred | ForEach-Object {$_.Value} | fl

Replace {UPN} with mailbox UPN.

 

I am using it to copy all events that are sent to a resource calendar to a shared calendar on Sharepoint. I am using the trigger "When an Event is Added, Updated, or Deleted". I was able to connect to the Resource Calendar by getting the id from the PS command above. When calling Get-Credential, you must login with the UPN (username login) and password of the resource room itself. Then you will get the ID of the resource room calendar from the RestMethod call. Likewise, in the Flow itself, you must add the resource room's UPN as a connection on the trigger and then select that connection. Then you can add the id from above as a custom entry. That worked for me, but YMMV


@Anonymous wrote: When calling Get-Credential, you must login with the UPN (username login) and password of the resource room itself. Then you will get the ID of the resource room calendar from the RestMethod call. Likewise, in the Flow itself, you must add the resource room's UPN as a connection on the trigger and then select that connection. Then you can add the id from above as a custom entry. That worked for me, but YMMV

How do you find the password of the resource item?  Since resources are shared with everyone, everyone has access and have never put in or used a password associated with a resource.

Anonymous
Not applicable

It was a little bit weird. I created the resource room a few days ago but don't recall setting a password for it. However, I am an O365 admin, so I went into admin center and reset the password to something of my choosing. Then I logged in like it was a normal account when prompted with Get-Credentials and with MS Flow's Connector.

 

You can test to make sure you have the credentials correct by logging into portal.office.com. It'll take you to the office landing page, but you won't have access to any apps since it's not a licensed user account.


@Anonymous wrote:

It was a little bit weird. I created the resource room a few days ago but don't recall setting a password for it. However, I am an O365 admin, so I went into admin center and reset the password to something of my choosing. Then I logged in like it was a normal account when prompted with Get-Credentials and with MS Flow's Connector.



How did you add a password to the resource?  I see no option in Exchange admin center to add or change a password for resources.

I also did a google search for changing the password and found some instructions using power shell, but the command (Set-Mailbox) they listed comes back with an error that it doesn't exists.  See command below.  Also found a forum post from Microsoft saying it isn't possible to set a password on a resource calendar.  So I'm still stuck. I'm fairly certain If I was able to login to Flow with resource calendar credentials things would work.  I tried using the custom entry option for the calendar ID and provided the ID string for the resource calendar, but it returned an error too.

 

Set-Mailbox -MicrosoftOnlineServicesID largeconference@domain.com -RoomMailboxPassword (ConvertTo-SecureString $newpass -AsPlainText -Force) -EnableRoomMailboxAccount $true

Anonymous
Not applicable

I found the resource room was in the User list in Admin center and I reset it like it was a normal, unlicensed account in the web app gui. Also, from my experience, you are correct in thinking that if we can log in as the resource in Flow that the triggers or actions related to that mailbox should work correctly. That's how it worked for me at least.


@Anonymous wrote:

I found the resource room was in the User list in Admin center and I reset it like it was a normal, unlicensed account in the web app gui. Also, from my experience, you are correct in thinking that if we can log in as the resource in Flow that the triggers or actions related to that mailbox should work correctly. That's how it worked for me at least.



I finally got this to work, however a little differently then how you described.  I actually did not need to get the long ID string from PowerShell for the resource calendar.  All I needed was to add a connector for the particular resource.  Once I was able to add/change the password for the resource (thanks), then I found the convoluted way to add the resource connector to the flow.  By default it wants to use your own account as the connector. One would think that clicking on "Manage Connections" once in the connections window would allow one to add or assign new connections.  But no, it only allows you to delete or view your connections.  It allows you to add owners, but not connections.  Very poor design.

 

To add the trigger connection for the resource you click on the triple dots next to the first flow step.  In my case it was "When an upcoming event is starting soon".  Clicking on the three dots to the right, allows you to add an additional connector there and will prompt for the credentials.  You can now select that connector to be used as the trigger. Once you do this, then when you select the drop down for selecting the calendar item, it is now using that resource calendar.  I know this because if you save and then come back in to look at that same box, it will be populated with the crazy long ID string of that calendar.  I compared this with the ID I obtained from the powershell commands and they were identical.  For somebody new to this tool this probably is hard to follow and doesn't make much sense.  So as I firm up the steps I plan to post a detailed description how I got this to work.  Once you figure it out it's not too bad, it is just not intuitive at all.  Poor instructions and conflicting information in forums even from Microsoft representatives. Most say it can't be done, but it clearly can and I have now set a flow to notify two staff people 2 hour in advance of computer resource reservation.

 

Microsoft may have added some of this functionality in the past months to flow, so I don't know if this was doable all along or has just become possible with some changes from Microsoft.

 

 

 

Now if Microsoft would add a description field to the resource calendar items that people could view, I would be a very happy camper.

Anonymous
Not applicable

Dave,

 

Awesome, I'm glad you figured it out as well. What you describe is exactly how I did it. After my initial post, I also noticed that the long string ID I plugged into the Flow changed itself to the default "Calendar" much like it does for any other mailbox, so the Powershell steps are probably not necessary. Thanks for providing a clear, succinct description of those steps. This is a very useful functionality to unlock. Thanks to everyone who commented previously for getting us here.

 

I am using this to emulate the older Sharepoint functionality of tying a mailbox to a Sharepoint Calendar. My team members can email the resource room, and then with some straightforward Flow logic (trigger when an event is added), it adds the event to the Calendar List. The Flow logic took some working with to get right. You have to do some string operations on the start and end time to remove the timezone from the timestamps themselves and check if the event is an all-day event because there is currently no way to add an item to a calendar list as an all-day event.

 

Cheers!

 

Greg

Here are the detailed instructions I promised. I had screen shots for some steps, but couldn't paste them with this forum layout, so hopefully the words are adequate.

 

Instructions for creating a Flow for notification of upcoming event on a resource calendar.  (this assumes you have an o365 account that includes Flow)

  1. Login to O365 portal office.com
  2. Click on the waffle icon at top left and select Flow (may need to click see all apps)
  3. Select My Flows at the top if you aren’t already there.
  4. Select create from blank or create from template on the top bar.(my example I’m choosing create from blank)
  5. Create from blank opens a new window, just choose create from blank button on this screen
  6. It will prompt for a tigger/connector, choose Office 365 Outlook icon, scroll down the resulting list and select "When an upcoming event is starting soon"
  7. Click on the three dots in the top left of the blue bar on the first flow step
  8. If you are creating a notice based on your own calendar select your email address in the resulting menu under "My Connections". If this is for a resource or other calendar you will need to add a new connection if not listed.
    1. Click add new connection
    2. Supply the email address of the resource calendar and enter the password.
      1. A password will need to be created for the resource. By default resources either don't have a password or it isn't known when it is initially setup. Go to the users section in O365 admin to add the password.
      2. Enter in a password and uncheck the box for having the person needing to change it upon login.
  9. After the connection is chosen, select "Calendar" from the drop down box in this first step
  10. If you wish to change from the default look ahead of 15 minutes, click on "Show advanced options" link and add in your value in minutes.
  11. Click Next Step, then add action
  12. Pick the Office 365 Outlook connector as we are going to send an email, then scroll down and pick "Send an Email" option
  13. Fill in the fields and click Save.
  14. You have now completed the flow and you can test it by adding a calendar item to the resource calendar you used above for the connector. Remember to set the event out further than the look ahead time you set.
  15. Check your email box for the email once the look ahead time has passed. If you don't get an email check the Run History for the Flow to see any error messages. If it runs it should show "Succeeded" with a green check.

Please feel to share, add to or improve these instructions.  - Dave -

Anonymous
Not applicable

Hi, thanks for your precious help !! I am looking for a way to connect to a category (different colours to add to an event) in Outlook Calendar. So I would need a category ID instead of the calendar ID - you rhink it's possible to obtain that somehow ? 

Anonymous
Not applicable

Not sure about the categories. I would think that's a property of the event, not a resource with an id. Does MS Flow have any functionality to check the category of an event?


@Anonymous wrote:

Hi, thanks for your precious help !! I am looking for a way to connect to a category (different colours to add to an event) in Outlook Calendar. So I would need a category ID instead of the calendar ID - you rhink it's possible to obtain that somehow ?

Anonymous
Not applicable

Hello

 

I have problems getting the Calendar ID, so your description sounds perfect. My problem is that when I add the connection with my resource address I'm not asked for a password and it put my own address in instead. (Even if I did make a password). This does'nt help me while this connection I alreday have.

 

Any suggestions?

Helpful resources

Announcements

Copilot Cookbook Challenge | Win Tickets to the Power Platform Conference

We are excited to announce the "The Copilot Cookbook Community Challenge is a great way to showcase your creativity and connect with others. Plus, you could win tickets to the Power Platform Community Conference in Las Vegas in September 2024 as an amazing bonus.   Two ways to enter: 1. Copilot Studio: https://aka.ms/CS_Copilot_Cookbook_Challenge 2. Power Apps Copilot Cookbook Gallery: https://aka.ms/PA_Copilot_Cookbook_Challenge   There will be 5 chances to qualify for the final drawing: Early Bird Entries: March 1 - June 2Week 1: June 3 - June 9Week 2: June 10 - June 16Week 3: June 17 - June 23Week 4: June 24 - June 30     At the end of each week, we will draw 5 random names from every user who has posted a qualifying Copilot Studio template, sample or demo in the Copilot Studio Cookbook or a qualifying Power Apps Copilot sample or demo in the Power Apps Copilot Cookbook. Users who are not drawn in a given week will be added to the pool for the next week. Users can qualify more than once, but no more than once per week. Four winners will be drawn at random from the total qualifying entrants. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once. If they are drawn multiple times, another user will be drawn at random. Prizes:  One Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value, does not include travel, lodging, or any other expenses) Winners are also eligible to do a 10-minute presentation of their demo or solution in a community solutions showcase at the event. To qualify for the drawing, templates, samples or demos must be related to Copilot Studio or a Copilot feature of Power Apps, Power Automate, or Power Pages, and must demonstrate or solve a complete unique and useful business or technical problem. Power Automate and Power Pagers posts should be added to the Power Apps Cookbook. Final determination of qualifying entries is at the sole discretion of Microsoft. Weekly updates and the Final random winners will be posted in the News & Announcements section in the communities on July 29th, 2024. Did you submit entries early?  Early Bird Entries March 1 - June 2:  If you posted something in the "early bird" time frame complete this form: https://aka.ms/Copilot_Challenge_EarlyBirds if you would like to be entered in the challenge.

May 2024 Community Newsletter

It's time for the May Community Newsletter, where we highlight the latest news, product releases, upcoming events, and the amazing work of our outstanding Community members.   If you're new to the Community, please make sure to follow the latest News & Announcements and check out the Community on LinkedIn as well! It's the best way to stay up-to-date with all the news from across Microsoft Power Platform and beyond.        COMMUNITY HIGHLIGHTS Check out the most active community members of the last month! These hardworking members are posting regularly, answering questions, kudos, and providing top solutions in their communities. We are so thankful for each of you--keep up the great work! If you hope to see your name here next month, follow these awesome community members to see what they do!   Power AppsPower AutomateCopilot StudioPower PagesWarrenBelzcreativeopinionExpiscornovusFubarAmikNived_NambiarPstork1OliverRodriguesmmbr1606ManishSolankiMattJimisonragavanrajantimlSudeepGhatakNZrenatoromaoLucas001iAm_ManCatAlexEncodianfernandosilvaOOlashynJmanriqueriosChriddle  BCBuizerExpiscornovus  a33ikBCBuizer  SebSDavid_MA  dpoggermannPstork1     LATEST NEWS   We saw a whole host of amazing announcements at this year's #MSBuild, so we thought we'd share with you a bite sized breakdown of the big news via blogs from Charles Lamanna, Sangya Singh, Ryan Cunningham, Kim Manis, Nirav Shah, Omar Aftab, and ✊🏾Justin Graham :   New ways of development with copilots and Microsoft Power PlatformRevolutionize the way you work with Automation and AIPower Apps is making it easier for developers to build with Microsoft Copilot and each otherCopilot in Microsoft Fabric is now generally available in Power BIUnlock new levels of productivity with Microsoft Dataverse and Microsoft Copilot StudioMicrosoft Copilot Studio: Building copilots with agent capabilitiesMicrosoft Power Pages is bringing the new standard in secure, AI-powered capabilities   If you'd like to relive some of the highlights from Microsoft Build 2024, click the image below to watch a great selection of on-demand Keynotes and sessions!         WorkLab Podcast with Charles Lamanna   Check out the latest episode of the WorkLab podcast with CVP of Business Apps and Platforms at Microsoft, Charles Lamanna, as he explains the ever-expanding evolution of Copilot, and how AI is offering new opportunities for business leaders. Grab yourself a coffee and click the image below to take a listen.       Event Recap: European Collaboration and Cloud Summits 2024   Click the image below to read a great recap by Mark Kashman about the recent European Collaboration Summit and European Cloud Summit held in Germany during May 2024. Great work everybody!       UPCOMING EVENTS European Power Platform Conference - SOLD OUT! Congrats to everyone who managed to grab a ticket for the now SOLD OUT European Power Platform Conference, which takes place in beautiful Brussels, Belgium, on 11-13th June. With a great keynote planned from Ryan Cunningham and Sangya Singh, plus expert sessions from the likes of Aaron Rendell, Amira Beldjilali, Andrew Bibby, Angeliki Patsiavou, Ben den Blanken, Cathrine Bruvold, Charles Sexton, Chloé Moreau, Chris Huntingford, Claire Edgson, Damien Bird, Emma-Claire Shaw, Gilles Pommier, Guro Faller, Henry Jammes, Hugo Bernier, Ilya Fainberg, Karen Maes, Lindsay Shelton, Mats Necker, Negar Shahbaz, Nick Doelman, Paulien Buskens, Sara Lagerquist, Tricia Sinclair, Ulrikke Akerbæk, and many more, it looks like the E in #EPPC24 stands for Epic!   Click the image below for a full run down of the exciting sessions planned, and remember, you'll need to move quickly for tickets to next year's event!       AI Community Conference - New York - Friday 21st June Check out the AI Community Conference, which takes place at the Microsoft Corporate building on Friday 21st June at 11 Times Square in New York City. Here, you'll have the opportunity to explore the latest trends and breakthroughs in AI technology alongside fellow enthusiasts and experts, with speakers on the day including Arik Kalininsky, Sherry Xu, Xinran Ma, Jared Matfess, Mihail Mateev, Andrei Khaidarov, Ruven Gotz, Nick Brattoli, Amit Vasu, and more. So, whether you're a seasoned professional or just beginning your journey into AI, click the image below to find out more about this exciting NYC event.       TechCon365 & Power Platform Conference - D.C. - August 12-16th ** EARLY BIRD TICKETS END MAY 31ST! ** Today's the perfect time to grab those early bird tickets for the D.C. TechCon365 & PWRCON Conference at the Walter E Washington Center on August 12-16th! Featuring the likes of Tamara Bredemus, Sunny Eltepu, Lindsay Shelton, Brian Alderman, Daniel Glenn, Julie Turner, Jim Novak, Laura Rogers, Microsoft MVP, John White, Jason Himmelstein, Luc Labelle, Emily Mancini, MVP, UXMC, Fabian Williams, Emma Wiehe, Amarender Peddamalku, and many more, this is the perfect event for those that want to gain invaluable insights from industry experts. Click the image below to grab your tickets today!         Power Platform Community Conference - Sept. 18-20th 2024 Check out some of the sessions already planned for the Power Platform Community Conference in Las Vegas this September. Holding all the aces we have Kristine Kolodziejski, Lisa Crosbie, Daniel Christian, Dian Taylor, Scott Durow🌈, David Yack, Michael O. and Aiden Kaskela, who will be joining the #MicrosoftCommunity for a series of high-stakes sessions! Click the image below to find out more as we go ALL-IN at #PPCC24!       For more events, click the image below to visit the Community Days website.    

Celebrating the May Super User of the Month: Laurens Martens

  @LaurensM  is an exceptional contributor to the Power Platform Community. Super Users like Laurens inspire others through their example, encouragement, and active participation. We are excited to celebrated Laurens as our Super User of the Month for May 2024.   Consistent Engagement:  He consistently engages with the community by answering forum questions, sharing insights, and providing solutions. Laurens dedication helps other users find answers and overcome challenges.   Community Expertise: As a Super User, Laurens plays a crucial role in maintaining a knowledge sharing environment. Always ensuring a positive experience for everyone.   Leadership: He shares valuable insights on community growth, engagement, and future trends. Their contributions help shape the Power Platform Community.   Congratulations, Laurens Martens, for your outstanding work! Keep inspiring others and making a difference in the community!   Keep up the fantastic work!        

Check out the Copilot Studio Cookbook today!

We are excited to announce our new Copilot Cookbook Gallery in the Copilot Studio Community. We can't wait for you to share your expertise and your experience!    Join us for an amazing opportunity where you'll be one of the first to contribute to the Copilot Cookbook—your ultimate guide to mastering Microsoft Copilot. Whether you're seeking inspiration or grappling with a challenge while crafting apps, you probably already know that Copilot Cookbook is your reliable assistant, offering a wealth of tips and tricks at your fingertips--and we want you to add your expertise. What can you "cook" up?   Click this link to get started: https://aka.ms/CS_Copilot_Cookbook_Gallery   Don't miss out on this exclusive opportunity to be one of the first in the Community to share your app creation journey with Copilot. We'll be announcing a Cookbook Challenge very soon and want to make sure you one of the first "cooks" in the kitchen.   Don't miss your moment--start submitting in the Copilot Cookbook Gallery today!     Thank you,  Engagement Team

Announcing Power Apps Copilot Cookbook Gallery

We are excited to share that the all-new Copilot Cookbook Gallery for Power Apps is now available in the Power Apps Community, full of tips and tricks on how to best use Microsoft Copilot as you develop and create in Power Apps. The new Copilot Cookbook is your go-to resource when you need inspiration--or when you're stuck--and aren't sure how to best partner with Copilot while creating apps.   Whether you're looking for the best prompts or just want to know about responsible AI use, visit Copilot Cookbook for regular updates you can rely on--while also serving up some of your greatest tips and tricks for the Community. Check Out the new Copilot Cookbook for Power Apps today: Copilot Cookbook - Power Platform Community.  We can't wait to see what you "cook" up!    

Welcome to the Power Automate Community

You are now a part of a fast-growing vibrant group of peers and industry experts who are here to network, share knowledge, and even have a little fun.   Now that you are a member, you can enjoy the following resources:   Welcome to the Community   News & Announcements: The is your place to get all the latest news around community events and announcements. This is where we share with the community what is going on and how to participate.  Be sure to subscribe to this board and not miss an announcement.   Get Help with Power Automate Forums: If you're looking for support with any part of Power Automate, our forums are the place to go. From General Power Automate forums to Using Connectors, Building Flows and Using Flows.  You will find thousands of technical professionals, and Super Users with years of experience who are ready and eager to answer your questions. You now have the ability to post, reply and give "kudos" on the Power Automate community forums. Make sure you conduct a quick search before creating a new post because your question may have already been asked and answered. Galleries: The galleries are full of content and can assist you with information on creating a flow in our Webinars and Video Gallery, and the ability to share the flows you have created in the Power Automate Cookbook.  Stay connected with the Community Connections & How-To Videos from the Microsoft Community Team. Check out the awesome content being shared there today.   Power Automate Community Blog: Over the years, more than 700 Power Automate Community Blog articles have been written and published by our thriving community. Our community members have learned some excellent tips and have keen insights on the future of process automation. In the Power Automate Community Blog, you can read the latest Power Automate-related posts from our community blog authors around the world. Let us know if you'd like to become an author and contribute your own writing — everything Power Automate-related is welcome.   Community Support: Check out and learn more about Using the Community for tips & tricks. Let us know in the Community Feedback  board if you have any questions or comments about your community experience. Again, we are so excited to welcome you to the Microsoft Power Automate community family. Whether you are brand new to the world of process automation or you are a seasoned Power Automate veteran - our goal is to shape the community to be your 'go to' for support, networking, education, inspiration and encouragement as we enjoy this adventure together.     Power Automate Community Team

Users online (2,796)