Forum Discussion
cschuster
Mar 01, 2022Brass Contributor
Sending a Teams Message from Power Automate with Mention is failing
Hi,
we are using a Power Automate Flow to send Teams Messages.
This Flow is activated from a http call.
But we are getting constant errors "Message mention text needs to be specified."
This is the json for the adaptive card:
{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"text": "Hi <at>John</at>"
}
],
"$schema": "https://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.4",
"msteams": {
"entities": [
{
"type": "mention",
"text": "<at>John</at>",
"mentioned": {
"id": "{Office365 User GUID}",
"name": "John Doe"
}
}
]
}
}
}
Any Ideas how to solve this?
for the User Id i tried my email and also the guid from the Graph Api Explorer...
cschuster - We are sharing our flow package zip. Please check and confirm if this works at your end?
- Meghana-MSFTMicrosoftWe are looking into this. We will update you
- cschusterBrass Contributorthe sample is taken from the Microsoft Documentation:
https://docs.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/cards/cards-format?tabs=adaptive-md%2Cconnector-html#sample-adaptive-card-with-a-mention
i tried several formats for the UserID:
8:guid
8:origd:guid
21:guid
21:orgid:guid
email
but i also found some answers which didnt work...
https://docs.microsoft.com/en-us/answers/questions/496290/-41.html
https://docs.microsoft.com/en-us/answers/questions/195557/how-do-i-mention-a-team-member-in-an-adaptive-card.html- Meghana-MSFTMicrosoft
cschuster - I ran a flow manually with the following JSONs and it worked. I tried with both email ID and User ID. Please try with the below JSON and it should work.
ID can be fetched from the activity as follows
from: {
id: '29:15fREhoUuf6vVCOuaJYVH-AB6QXXX',
name: 'MOD Administrator',
aadObjectId: 'XXXX'
}{ "type": "AdaptiveCard", "body": [ { "type": "TextBlock", "text": "Hello new test <at>Mod</at>" } ], "$schema": "https://adaptivecards.io/schemas/adaptive-card.json", "version": "1.0", "msteams": { "entities": [ { "type": "mention", "text": "<at>Mod</at>", "mentioned": { "id": "admin@m365x654992.onmicrosoft.com", "name": "Mod" } } ] } }
{ "type": "AdaptiveCard", "body": [ { "type": "TextBlock", "text": "Hi <at>Mod</at>" } ], "$schema": "https://adaptivecards.io/schemas/adaptive-card.json", "version": "1.0", "msteams": { "entities": [ { "type": "mention", "text": "<at>Mod</at>", "mentioned": { "id": "4exxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx8", "name": "Mod" } } ] } }