Hello everybody,
Before going into the details of my issue, I have looked into other posts on this community but I could not find the answer there.
I have a quite simple flow.
When a new news post has been created on a specific SharePoint site, the flow should trigger.
In the end, the flow should post a message into a Teams channel and it should mention all the team members for visibility.
How I do that?
It triggers when a new item has been created.
A trigger condition is specified to only start when the PromotedState value equals 2.
@equals(triggerBody()?['PromotedState'],2)
So far so good. The trigger works fine.
Next step, retrieving the Microsoft 365 group members of the team where I will post a message, and putting these members in a string type variable:
Still working as expected.
Last step, posting the message.
This steps results in an error.
Error details
Unexpected character encountered while parsing value: E. Path '', line 0, position 0.
at Newtonsoft.Json.JsonTextReader.ParseValue()
at Newtonsoft.Json.Linq.JArray.Load(JsonReader reader, JsonLoadSettings settings)
at Newtonsoft.Json.Linq.JArray.Parse(String json, JsonLoadSettings settings)
Please find the body of the Post a Message (Teams) action card below.
I checked the body of the message and put it in jsonlint, no validation errors.
I hope that someone could help me understand what's going on here!
Thanks a lot.
Joost
Body
{
"recipient": {
"groupId": "0481xxxx-xxxx-xxxx-xxxx-xxxx3a7d055a",
"channelId": "19:xxxxxxxxxxxxxxxxxxxxf4a6d944xxxx@thread.tacv2"
},
"messageBody": "<p>\n<b>Er staat directienieuws voor je klaar!</b><br>\n<a href=\"https://orgname.sharepoint.com/sites/Directienieuws/SitePages/Directienieuws-week-6---2021.aspx\">Klik hier</a> om het nieuwsbericht te openen.</p>\n<at>username@org.nl</at><at>username@org.nl</at><at>username@org.nl</at><at>username@org.nl</at><at>username@org.nl</at><at>username@org.nl</at><at>username@org.nl</at><at>username@org.nl</at><at>username@org.nl</at><at>username@org.nl</at><at>username@org.nl</at><at>username@org.nl</at><at>username@org.nl</at><at>username@org.nl</at><at>username@org.nl</at><at>username@org.nl</at><at>username@org.nl</at><at>username@org.nl</at><at>username@org.nl</at><at>username@org.nl</at><at>username@org.nl</at><at>username@org.nl</at><at>username@org.nl</at><at>username@org.nl</at><at>username@org.nl</at><at>username@org.nl</at><at>username@org.nl</at><at>username@org.nl</at><at>username@org.nl</at><at>username@org.nl</at><at>username@org.nl</at><at>username@org.nl</at><at>username@org.nl</at>"
}
That's fair, thank you
Please post this as a new question. You'll get more responses and others will be able to find the answer more easily later.
I have an issue with Parse JSON processing \n in the body content. I tried to use split to make the \n a comma, and I tried using replace as you suggested, but I can't even update the function because it's invalid. The ai says that my flow doesn't support split or replace, and when I ask it to help it gives me another blank compose action and throws a send email onto the end of my flow. Not helpful, and I haven't seen anyone else with quite the same problem.
Here is my compose function:
Here is an excerpt of the output content the Parse JSON needs to process:
Hi @twlarrywu unfortunately not for mentioning multiple users individually.
I basically worked around my issue by mentioning the channel instead.
Hope someone else can help us out with that.
Hi,
I have the same issue.(worked fine on 4 or 5 recipients, it will be failed easily if we have <at>xxx </at> more than 10 email.
Do you or anyone find the workaround or solution?
Hi @simorav if you break your flow down by trying to mention several users manually. Does it work for some users? That might indicate a provisioning issue.
I notice that your input for action "Get @mention token for a user" contains a variable. What is the value of that variable? Because here I see that the email address of a user is used as input: Tag a User in a Microsoft Teams post made using Power Automate | D365 Demystified
Maybe first you can get all group members and then for each user and get the token for each member:
This would be the output:
Of course you can filter out users from within the apply to each action.
Hope this helps
Hi @jvdlinden,
I receive in input the list of users to be mentioned, then I get the mention token and then I use these token in the message (see the screen below).
For some users (e.g. guests) I'm not able to retrieve the token, then I added the try catch block to avoid flow failure. In this way I suppose that remaining mentions should be ok. Unfortunately, when I try to set mentions in the message, the task fail with this error:
Hi @simorav can you share some additional details (print screen) of what you are using in your flow right now?
Hi @jvdlinden ,
thanks for the quick response 🙂
I cannot mention the channel, but I need to mention a list of users. Unfortunately I'm not sure that all the users are mentionable, in fact I cannot find some of these users with a manual mention too. Can I check in some way these situation and remove broken mentions?
Thansk, regards
Hi @simorav ,
I was able to find a solution. Sorry for not updating this post.
Currently you cannot mention the team. You can mention a channel or an individual user with Power Automate / Logic apps. Please take a look here: Mention a channel with Flow – Expiscornovus
In my case I mention the "General" channel of the team (this includes all team members).
PS: you can use the v1.0 endpoint from Microsoft Graph instead of the beta endpoint.
If you need additional info just reply 🙂
Michael E. Gernaey
497
Super User 2025 Season 2
David_MA
436
Super User 2025 Season 2
Riyaz_riz11
244
Super User 2025 Season 2