Share attendance directly after meeting

Microsoft Teams stores the attendance in a report directly after the meeting. In this blog I will show you how you can retrieve that information and share it in an e-mail via a Power Automate flow.

Inspiration

This question from borensm:

Not looking for the list of invitees but those that actually attended the meeting (subset of those invited).

Power Users Community thread: Capture Meeting Attendees

doughnutchart_embedded

List attendanceRecords method

In one of my earlier blogs I showed you how you could retrieve the transcript after the meeting. This setup uses a similar approach.

When navigating through the Graph API documents I noticed there was also a List meetingAttendanceReports method. The List meetingAttendanceReports method can be used to retrieve a list of attendance reports for an online meeting.

But the more surprising one was the List attendanceRecords method. This method can be used to retrieve the attendance records of an online meeting. It even shows things like seconds joined in meeting.

QuickChart.io

To make the flow a bit more challenging I also wanted to present that information in a visual appealing way. I decided to use the show the information in a doughnut chart.

Paul Murana has written a great blog about this using QuickChart.io approach. I highly recommend looking at his blog about this: How to generate a chart with Power Automate.

Flow setup

Checklist before you start:
– This example uses HTTP connector actions which are part of a premium feature, make sure you have a license which covers this.
– The HTTP actions also use an app (with the correct Graph API permissions) in Azure Active Directory for authentication.

attendance_chart_aftermeeting

1. Add a When an upcoming event is starting soon (V3) action.

whenanupcomingeventisstartingsoon

a. Select your Calendar Id, in this case Calendar

2. Add a Get my profile (v2) action.
To retrieve my own email to send the message to.

getmyprofile_02

3. Add a Initialize variable action.

onlinemeetingvariable

a. Provide a Name, in this example onlineMeetingId
b. Select a Type, String
c. Leave Value empty

4. Add a second Initialize variable action.

attendancereportid_variable

a. Provide a Name, in this example AttendanceReportId
b. Select a Type, String
c. Leave Value empty

5. Add a Condition action.
In this condition the body field within the body is checked for the meetup-join hyperlink. A indexOf function is used. If this is found it will output 1. If it is not found (equal to -1), it will output 0.

condition_checkifteamsmeeting

a. Use the expression below for the where statement

6. Add a HTTP action (in the If Yes section).
A Get onlineMeeting method from the Graph API is used. In this case specifically with a $filter query parameter and the JoinWebUrl. This is information we can retrieve from the body/body of the event message.

onlinemeetingid_graph

a. Select the GET method
b. Use the URI from the code snippet below

c. Select Active Directory OAuth for the Authentication, provide the details of your Azure AD App.

7. Add a Set Variable action (in the If Yes section).

setvariable_onlinemeetingid

a. In the Name field select the onlineMeetingId variable
b. In the Value field use the expression from the code snippet below

8. Add a Delay until action (in the If Yes section).

delayuntil_30minutesafterscheduledmeetingend

a. In the Timestamp field use the expression from the code snippet below

9. Add a second HTTP action (in the If Yes section).
A List meetingAttendanceReports method is used to retrieve a list of attendance reports for the specific online meeting.

listattendancereports

a. Select the GET method
b. Use the URI from the code snippet below

c. Select Active Directory OAuth for the Authentication, provide the details of your Azure AD App.

10. Add a second Condition action (in the If Yes section).
In this condition a length function is used to check how many items are returned by the previous HTTP action. If this is greater than 0 we continue with the rest of the steps.

checkifattendancereportexists

a. Use the expression below for the where statement

11. Add a second Set Variable action (in the If Yes section of the second condition).

setattendancereport_variable

a. In the Name field select the AttendanceReportId variable
b. In the Value field use the expression from the code snippet below

12. Add a third HTTP action (in the If Yes section of the second condition).
A List attendanceRecords method is used to retrieve the attendance records of the specific online meeting.

http_listattendancerecords

a. Select the GET method
b. Use the URI from the code snippet below

c. Select Active Directory OAuth for the Authentication, provide the details of your Azure AD App.

13. Add a Select action (in the If Yes section of the second condition).

selectattendance

a. Use the expression from the code snippet below in the From field

b. Use the json from the code snippet below in the Map field

14. Add a second Select action (in the If Yes section of the second condition).

selectuser

a. Use the Output from the first Select in the From field
b. Switch to text mode and use the expression below from the code snippet in the Map field

15. Add a third Select action (in the If Yes section of the second condition).

selectmeetinginseconds

a. Use the Output from the first Select in the From field
b. Switch to text mode and use the expression below from the code snippet in the Map field

16. Add a fourth HTTP action (in the If Yes section of the second condition).
A HTTP request is used to generate a QuickChart.io chart.

http_quickchartio

a. Select the POST method
b. Use https://quickchart.io/chart for the URI field
c. Use the body from the code snippet below

17. Add a Compose action (in the If Yes section of the second condition).
The image will be embedded into the body of e-mail message. This action is the create an IMG tag with a base64 version of the image.

compose_imgtag

a. Use the value from the code snippet below in the Inputs

18. Add a Send an email (v2) action (in the If Yes section of the second condition).
In this example I am sharing it with myself. Obviously, you could change this setup to share it with others, like the organisers or the attendees, etc.

sendanemail

a. In the To use the Mail field of the Get User Profile (v2)
b. In the Body use the Outputs of the Compose action

That is it for the setup of this example.

Happy testing!

You may also like...

7 Responses

  1. Chandrasekaran says:

    Hi Dennis,

    Thanks for this blog. It is really helpful, and I learned a new thing today. Thanks. However, I do have one question, is it possible to get the attendance records for the Teams channel meeting using this approach? Please do let me know your thoughts on this.

    Thanks
    Chandrasekaran

  2. Dennis says:

    Hi Chandrasekaran,

    I think it should retrieve that for a Teams channel meeting as well. You can use the List channel messages method:
    https://learn.microsoft.com/en-us/graph/api/channel-list-messages?view=graph-rest-1.0&tabs=http

    With in those message you should be able to filter on contentType field with the value meetingReference within the Attachments array. In the content property within that same Attachments array there should be a meetingJoinUrl.

    You can use that in the flow like I shared earlier.

  3. Jay says:

    Dennis – This is such a great article and helped so much. Is this approach also available to to get the attendee report for meetings created by all Users in a tenant? I do see a Delegated App Permission option on the documentation, but haven’t come across anyone that’s got this working.

  4. Hari Haran says:

    Hi Dennis,
    I see this flow of yours and I create it the same flow. But I am getting ERROR in HTTP ACTION of this flow how to fix them. and How to I getSuccessful implementation of FLOW.I Request you to see my Error and Please solve it.

  5. vincenzo sguera says:

    great post..thanks…one info, permission are delegated or application for azure ?

    thanks

  6. marcos says:

    the first http give me error

    https://graph.microsoft.com/v1.0/users/@{outputs(‘Get_my_profile_(V2)’)?[‘body/id’]}/onlineMeetings?$filter=JoinWebUrl eq ‘@{if(equals(indexOf(triggerOutputs()?[‘body/body’], ‘https://teams.microsoft.com/l/meetup-join/’), -1), ‘No Teams Meeting’, concat(‘https://teams.microsoft.com/l/meetup-join/’, slice(split(split(triggerOutputs()?[‘body/body’], ‘https://teams.microsoft.com/l/meetup-join/’)[1], ‘class’)[0], 0, -2)))}’

  7. Dennis says:

    Hi Marcos,

    You have added the Get my profile (v2) action from step two, correct? Did you rename the action by any chance? If that is the case you would also have to update the expressions as well.

    If not, can you share what error you are getting?

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.