web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Unexpected character e...
Power Automate
Unanswered

Unexpected character encountered while parsing value: E. Path

(0) ShareShare
ReportReport
Posted on by 329

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. 

trigger.png

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:

groupmembers.png

 

Still working as expected.

Last step, posting the message.

PostMessage.png

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>"
}

 

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    69,129 Most Valuable Professional on at

    There are some \n newline characters embedded in the body of the message.  Have you tried removing those and replacing them with <br> since the formatting is HTML?

  • jvdlinden Profile Picture
    329 on at

    Hi @Pstork1 thanks for your effort,

     

    Unfortunately it does not help.

    At least I found out that it has to do with the string type variable. If I remove it, all works fine. This is the part where all the email addresses are inserted.

     

    Any suggestions are welcome! 🙂

     

    Edit1: I have done some more testing. Instead of using 33 email addresses, I tried with just 2. With 2 it works fine. Looks like it has something to do with the length?

     

  • simorav Profile Picture
    6 on at

    Hi @jvdlinden ,

    did you find a solution for your problem? I'm having the same problem now, in my opinion the problem is related with the fact that some mentioned users haven't the access to the channel, but I don't know how solve the problem. Any idea?

     

    Thanks, regards

  • jvdlinden Profile Picture
    329 on at

    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 🙂

  • simorav Profile Picture
    6 on at

    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

  • jvdlinden Profile Picture
    329 on at

    Hi @simorav can you share some additional details (print screen) of what you are using in your flow right now?

  • simorav Profile Picture
    6 on at

    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). 

     

    simorav_0-1629963400945.png

     

    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:

     

    {
      "error": {
        "code"500,
        "message""Unexpected character encountered while parsing value: E. Path '', line 0, position 0.\r\n   at Newtonsoft.Json.JsonTextReader.ParseValue()\r\n   at Newtonsoft.Json.Linq.JArray.Load(JsonReader reader, JsonLoadSettings settings)\r\n   at Newtonsoft.Json.Linq.JArray.Parse(String json, JsonLoadSettings settings)",
        "source""flow-apim-europe-001-northeurope-01.azure-apim.net",
        "path""choose[19]\\when[1]\\choose\\when[1]",
        "policyId""",
        "clientRequestId""xxxxx"
      }
    }
     
    I think that some of the users mentioned haven't access to the teams/channel, then the task fails. Any other idea?
    Thanks, regards
  • jvdlinden Profile Picture
    329 on at

    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:

    get_group_members.png

     

    This would be the output:

    output.png

     

    Of course you can filter out users from within the apply to each action.

    Hope this helps

  • twlarrywu Profile Picture
    4 on at

    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?

     

     

  • jvdlinden Profile Picture
    329 on at

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard