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...
- Mar 03, 2022
cschuster - We are sharing our flow package zip. Please check and confirm if this works at your end?
cschuster
Mar 02, 2022Brass Contributor
the 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
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
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-MSFT
Mar 02, 2022Former Employee
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"
}
}
]
}
}
- cschusterMar 02, 2022Brass Contributor
not working for me 😞
tried with my (primary) email, my default email (onmicrosoft.com) and your original json....
but a simple json is working fine:
{ "type": "AdaptiveCard", "body": [ { "type": "TextBlock", "text": "Hello new test" } ], "$schema": "https://adaptivecards.io/schemas/adaptive-card.json", "version": "1.4" }
- Meghana-MSFTMar 02, 2022Former EmployeeCan you please share your flow package zip?
- cschusterMar 02, 2022Brass Contributor
unfortunately no, i get an error every time i try to export the flow (even for a fresh created flow):