Hello,
I would like to use the User Presence in a powerApp.
How can I get this status ( Available, Out of Office, Busy, Busy In a call ... ).
How can be notified of changes ?
Thanks.
Solved! Go to Solution.
Hi @Jean-Christophe,
I was working exacly on this kind of topic today, the only information I found was using MS Graph API however, here is the workaround to use PoweAutomate and get the status of the user:
You will need to use the operator called Send an HTTP request to Sharepoint:
Once you select that, please enter the following information:
Uri: /v1/users/{id}/presence | Please replace the "{id}" with the user id that you need to found.
For example: /v1/users/{id}/presence ---> /v1/users/dc74d9bb-6afe-433d-8eaa-e39d80d3a647/presence
If you run the flow you will get a JSON output with all the information of the presence of the user:
{
"calendarData": {
"isOutOfOffice": false
},
"forcedAvailability": {
"expiry": "2022-01-20T02:34:00.0892683Z",
"availability": "Available",
"activity": "Available",
"publishTime": "2022-01-13T02:34:00.0892683Z"
},
"capabilities": [
"Audio",
"Video"
],
"availability": "Available",
"activity": "Available",
"lastActiveTime": "2022-01-13T02:14:38.545Z",
"nextRefreshTime": "2022-01-13T02:49:38.545Z",
"deviceType": "Desktop",
"sequenceNumber": 64204440
}
If you want to use a condition let say "If the user is with the status Do not Disturb don't send the email"
In order to do that you need to Parse the JSON using the operation called "Parse JSON"
This operation will request you 2 things, the content and the Schema of the JSON
for the content use the output of the previous task and for the Schema you will need to copy the JSON output and paste it into the option called "Generate a Schema"
Schema:
The Schema will make the JSON content like a "usable variables"
Now you can use a Condition and comparate the availability of the user:
Please keep in mind that the status shound be write like this:
If you have any question just let me know!!
I hope this work for you 😀
They answer is yes, you can get notified on status change.
MS Teams presence supports "change notification" feature:
Hi @RJ2K1,
I am really thankful for your idea, i just have one problem, when i try to do the flow this appears,
I don't know if I am missing something,
Thanks in advance for your help! 🙂
You could work around that using expression :
string('https://presence.teams.microsoft.com')
this works for me:
I'm kicking the automate from my Power App and the automate is going to grab the requesters presence. I have the presence in Graph API consented. What I and running into is the Automate when tested will get back my presence with no issues, but once change it to requesters presence it errors in the Send an Http Request to SharePoint method Get with 404 Not found.
I have followed the following:
https://docs.microsoft.com/en-us/graph/api/presence-get?view=graph-rest-1.0&tabs=http#code-try-9
https://powerusers.microsoft.com/t5/Building-Power-Apps/User-Presence-in-Teams-use-it-in-PowerApp/td...
@mdevaney and @RJ2K1 what would you say I did incorrectly or am missing that is not stated in this post?
@Pstork1 including you too in case you might have insight also. Appreciate each of you and your time. Thank you.
@RJ2K1 This is great, way easier that trying to use http request with Graph API.
I manage to make it work using /v1/me/presence
BUT when i use the /v1/users/{id}/presence does not work.
None of them worked.
How are you getting the ID or what ID are you using for the users?
Appreciated!
User | Count |
---|---|
258 | |
111 | |
95 | |
48 | |
41 |