Share this article
Improve this guide
How to update your Microsoft Teams status using Power Automate
7 min. read
Published onMarch 10, 2022
published onMarch 10, 2022
Share this article
Improve this guide
Read our disclosure page to find out how can you help Windows Report sustain the editorial teamRead more
In this article
Toggle
The ability to set yourMicrosoft Teamsstatus automatically can help break up your workday so you don’t feel chained to your PC as you work from home. Of course, you can always go into Microsoft Teams to manually change your status, but wouldn’t it be better to have the ability to change your Microsoft Teams status without ever opening the app?
Built forMicrosoft 365, using Power Automate saves time by streamlining tasks and workflows through automation. No need to worry if you’ve never created or automated a workflow, or “flow,” as there aremany popular app templates available.
Set your status
This guide is based on a guide by Damien Bird, aMicrosoft MVPwho created a post on how to perform aTeams Status Update via Power Automate. I will reiterate the warning Damien Bird left at the beginning of his guide as well.
This is an undocumented method andshould not be usedin production flows, it works, but not all the time, and there is alimit on the number of flows you can perform per day. So, it’s important to keep your expectations in check.
Here are the links asthey appear in Damien Bird’s post:
In the USA?? Or using a US tenant? You might need to usehttps://noamdf.presence.teams.microsoft.comorhttps://presence.gcc.teams.microsoft.comor you will get a Status 301 error when the action runs.
Here’s what to do to set your Microsoft Teams status inPower Automate:
1.In Power Automate, clickMy flowsfrom the navigation pane on the left.2. ClickNew flow.3. Here, you have three options:Automated cloud flow,Instant cloud flow, orScheduled cloud flow. For this example, we will useInstant cloud flow.4. Create aFlow nameand click an option underChoose how to trigger this flow. For this example, we will useManually trigger a flow. ClickCreatewhen you are finished to confirm.5. After you clickCreate, you will find your new flow is created and it starts with a manually trigger, so you must pick the next step, clickNext step.6. Search for “SharePoint” in the search box and scroll and clickSend an HTTP request to SharePoint.
Set your Microsoft Teams status
- In the next menu, you will need to complete theHTTP request to SharePoint. Your SharePoint request should look exactly like the image below.You can change your“availability”status in the body of the flow to“Available”,“Busy”,“BeRightBack”,“DoNotDisturb”, or“Away”. I was unable to get the option for offline/offwork to function, so I can’t include it in this guide.2. ClickSavewhen finished.3. Next, your flow is ready to go, so you need to test it. It is not only recommended that you test it, but it’s also required when you set up your first flow. ClickTest.4. At the next screen, you need to indicate how you want to test your flow, eitherManually(you trigger it) orAutomatically(based on a previous run of another flow). SelectManually, the only choice at first flow setup. ClickTestto confirm.5. Depending on your permissions level, Power Automate may prompt you to sign into your Microsoft account to confirm your permissions to make the flow function. As indicated, I am ready to go because I already have the necessary permissions already as designated by the green check mark. ClickContinue.6. Finally, clickRun flowto run the flow.Once you clickRunyou will see a green check mark showing that your flow successfully started with a link to check the flow status on the Flow Runs Page. You can also check your Microsoft Teams status to see if it changed when you ran the flow.
Set your status message
To set your status message, you just need to create another Power Automate flow almost identical to the one above, except for a couple of changes. Here’s what your flow should look like.
Create a custom Microsoft Teams status connector
While looking up content for this guide, I cameacross a really cool Spotify project by another Microsoft MVP, Loryan Strant. It takes a Spotify custom connector with athorough guide created by That API Guyand updates their Microsoft Teams status to show what song and artist they are listening to on Spotify.
After following along with his guide, I found that another Microsoft MVP,Luise Freese provided a more efficient solution for the flow. So, my end result is a combination of both of their combined work combined with trial and error. Their guides were missing important explanations of dynamic values and expressions and what they do, but their guides are not meant for new Power Automate users either. After following both their guides, I created a Spotify custom connector with Microsoft Teams that aligns more with Freese’s solution, but if you have an even better solution, please share it.
If you are looking for an easier option, copy the code exactly as it appears below to either:1. Set yourMicrosoft Teams status to Away{“id”:“6e453f83-f22d-4715-bdb6-5cbe7b44b6fa”,“brandColor”:"#036C70",“connectionReferences”:{“shared_sharepointonline”:{“connection”:{“id”:"/providers/Microsoft.PowerApps/apis/shared_sharepointonline/connections/5d9bafd92370456789caa39b6c3f2277"}}},“connectorDisplayName”:“SharePoint”,“icon”:“https://connectoricons-prod.azureedge.net/releases/v1.0.1554/1.0.1554.2707/sharepointonline/icon.png","isTrigger":false,"operationName":"Set_Microsoft_Teams_status_to_Away","operationDefinition":{"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_sharepointonline","operationId":"HttpRequest","apiId":"/providers/Microsoft.PowerApps/apis/shared_sharepointonline"},"parameters":{"dataset":"https://presence.teams.microsoft.com","parameters/method":"PUT","parameters/uri":"/v1/me/forceavailability","parameters/headers":{"content-type":"application/json"},"parameters/body":"{\n\n"availability": “Offline”, \n"activity": “OffWork”\n\n}"},“authentication”:{“type”:“Raw”,“value”:"@json(decodeBase64(triggerOutputs().headers[‘X-MS-APIM-Tokens’]))['$ConnectionKey']"}},“runAfter”:{},“metadata”:{“operationMetadataId”:“e3433a3c-7e7c-40d5-b804-696b2b1d0398”}}}
2.Update your status message note{“id”:“638a81c6-7d9b-481a-8875-97a08dcf18b7”,“brandColor”:"#036C70”,“connectionReferences”:{“shared_sharepointonline”:{“connection”:{“id”:"/providers/Microsoft.PowerApps/apis/shared_sharepointonline/connections/5d9bafd92370456789caa39b6c3f2277"}}},“connectorDisplayName”:“SharePoint”,“icon”:“https://connectoricons-prod.azureedge.net/releases/v1.0.1554/1.0.1554.2707/sharepointonline/icon.png","isTrigger":false,"operationName":"Set_Microsoft_Teams_status_message_note_","operationDefinition":{"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_sharepointonline","operationId":"HttpRequest","apiId":"/providers/Microsoft.PowerApps/apis/shared_sharepointonline"},"parameters":{"dataset":"https://presence.teams.microsoft.com","parameters/method":"PUT","parameters/uri":"/v1/me/publishnote","parameters/headers":{"content-type":"application/json"},"parameters/body":"{\n\n"message": "I am away from my desk. I went to grab lunch"\n\n}\n “},“authentication”:{“type”:“Raw”,“value”:"@json(decodeBase64(triggerOutputs().headers[‘X-MS-APIM-Tokens’]))['$ConnectionKey']"}},“runAfter”:{},“metadata”:{“operationMetadataId”:“05f65dba-6bef-458a-81ac-b4fc08c290db”}}}
You can paste it straight into Power Automate by going toNew step > My clipboard. Paste it directly to the clipboard when you set up your Power Automate account.If you have any questions or need any help setting up this flow, have advice, or can give me input to make a better flow, pleasereach out to me on Twitter.
davew
User forum
0 messages
Sort by:LatestOldestMost Votes
Comment*
Name*
Email*
Commenting as.Not you?
Save information for future comments
Comment
Δ
davew