0
votes

I have created an bot for microsoft teams with power virtual agents. This bot works fine and people can talk with it in ms teams and give the bot some information about dates. For example you could tell the bot a start-date and an end-date for days you aren't able to work.

With the authentification in teams the bot also knows the username and the id of the person, who is talking with it.

Now I like to create an automated flow, which the bot should trigger with the infos like username, userid, startdate and enddate, which should do the following steps:

  1. open/find the specific user's calendar in outlook/teams (I'm pretty sure both use the same calendar)

  2. create for each day in the range of startdate and enddate a (full-day) entry, which says "unavailable"

  3. for each conflict with another meeting in entries of Step 2. cancel the meeting (for the user with username)

  4. post a summary in a specific ms teams channel

I got Step 4 already working fine.

Step 2, I think I've figured out aswell, but with regard to my following problem at Step 1:

There is the template flow: Get calendar, which returns (all?) available calendars. And there is another flow template for creating entries in a specific calendar(Step 2 with option full-day entry), which needs the calendar ID to work.

My big problem is, how am I supposed to get the calendar ID of a specific user?

Is there a way to get the specific calendarID for a username or a userid?

And then what can I do about Step 3?

Thank you a lot for your help.

greets Vulnin

1
Using Graph API you can get User Calendar ID GET https://graph.microsoft.com/v1.0/{id | userPrincipalName}/calendar. i.stack.imgur.com/Ngpkq.png For point 3 Only the organizer can cancel the meeting. Please refer to this document.Mamatha-MSFT
Firstly thank you for your help. Why do I need to "Parse JSON" as a second step? Is the answer of the get command not readable? And do you know, if I can use the HTTP Action in Power Automate even if I haven't a Premium Access. So canceling a meeting is probably too much, what about setting the user to "not attending"?Vulnin
Parse JSON in use is when you take the raw JSON output data from Power Automate and transform it into values. The output of GET command in http returns raw JSON so, you have to parse JSON to use values. You can decline a meeting using Graph API request with POST https://graph.microsoft.com/v1.0/users/{id | userPrincipalName}/events/{id}/decline request.Mamatha-MSFT

1 Answers

0
votes

Using Graph API you can get User Calendar ID GET https://graph.microsoft.com/v1.0/{id | userPrincipalName}/calendarenter image description here Parse JSON in use is when you take the raw JSON output data from Power Automate and transform it into values. The output of GET command in http returns raw JSON so, you have to parse JSON to use values.

For point 3 Only the organizer can cancel the meeting. Please refer to this document.

You can decline a meeting using Graph API request with POST https://graph.microsoft.com/v1.0/users/{id | userPrincipalName}/events/{id}/decline request.