Overview:
In this blog, we will learn how we can create a Teams Invite using Power
Automate. So, Let’s get started!
Business Requirement:
When a SharePoint List Item is created, we want to create a Microsoft Teams
Invite with the help of Power Automate! We have a list structure with the
following list schema. Now, let’s start building the flow.
Step 1:
Add a Trigger – “When an item is created”. Provide Site address and URL.
Step 2:
Initialize two variables with the type String and Array.
Step 3:
Create Attendees array using the following JSON structure. Here, we need to
provide “AttendeesDisplayName” and “Attendees Email”. This will automatically
add Apply to each loop.
{
"type": "required",
"emailAddress": {
"name": "@{items('Apply_to_each')?['DisplayName']}",
"address": "@{items('Apply_to_each')?['Email']}"
}
}
Step 4:
Set Meeting Body with the following structure.
{
"subject": "@{triggerOutputs()?['body/Title']}",
"body": {
"contentType": "HTML",
"content": "@{triggerOutputs()?['body/Description']}"
},
"start": {
"dateTime": "@{triggerOutputs()?['body/StartDate']}",
"timeZone": "UTC"
},
"end": {
"dateTime": "@{triggerOutputs()?['body/EndDate']}",
"timeZone": "UTC"
},
"location": {
"displayName": "Online"
},
"attendees": @{variables('vAttendees')} ,
"isOnlineMeeting": true,
"onlineMeetingProvider": "teamsForBusiness"
}
Step 5:
Add an action – “Invoke an HTTP request”
Add Method as “POST”
Add URL of the request, Headers, and pass “MeetingBody” for the body of the
request.
Click on ellipses and select - "Add new connection"
Provide Base Resource URL and Azure AD Resource URI for Microsoft Graph.
Step 6:
Now, let’s save & test the flow.
Flow ran successfully.
Teams invite has been generated successfully.
Conclusion:
This is how we can simply create Power Automate flow to create Teams Meeting
invite! Happy Power Apping!
If you have any questions you can reach out our
SharePoint Consulting
team
here.
No comments:
Post a Comment