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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / multi line string in j...
Power Automate
Unanswered

multi line string in json is being rejected.

(0) ShareShare
ReportReport
Posted on by 10

I'm trying to build my first integration between two platforms. Starting simple. I have the Webhooks receiver working. I've also successfully piped that info into the end platform. 

 

Here's my json that is NOT working:

 

 

 

 

{
	"customer_id": "21742107",
	"subject": "A Subject",
	"problem_type": "Contract Work",
	"user_id": "129173",
	"contact_id": "1153967",
	"location_id": "0",
	"comments_attributes": [
		{
			"subject": "A subject",
			"body": "Alert Details: \nOrganization:"
		}
	]
}

 

 

 

 

Here is the json that works:

 

 

 

 

{
	"customer_id": "21742107",
	"subject": "A Subject",
	"problem_type": "Contract Work",
	"user_id": "129173",
	"contact_id": "1153967",
	"location_id": "0",
	"comments_attributes": [
		{
			"subject": "A subject",
			"body": "Alert Details: Organization:"
		}
	]
}

 

 

 

 

The error I'm getting is:

 

Unable to process template language expressions in action 'HTTP' inputs at line '1' and column '7956': 'Error reading string. Unexpected token: StartArray. Path 'queries.comments_attributes'.'.

 

Obviously, the issue is the newline. I've tried 0, 1, 2, 3 and 4 backslashes. Except, every json validator I can find says both the top and the bottom json are valid. I even tried inserting Compose in front of my http function to format that field prior to calling it. Same error. 

 

So, bottom line, I want to format that one value, but PA won't let me put a newline in there. Well, it lets me put the newline in there and doesn't complain about it, but the process fails every time. 

 

Does anyone have a clue stick to hit this newbie upside the head? I

 

Thanks,

 

Airneil

 

 

Categories:
I have the same question (0)
  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi

     

    Under the Parse JSON Action step the above sample data works. So which steps you having the error? Could you please show a screenshot? Also try using the escape characters. See below link.

     

    escaping - How to escape a JSON string containing newline characters using JavaScript? - Stack Overflow

     

    Thanks

  • Airneil Profile Picture
    10 on at

    Hi abm,

    Thank you for your reply. I will do my best to answer your questions. 

     

    The full error message given is, "Unable to process template language expressions in action 'HTTP' inputs at line '1' and column '7956': 'Error reading string. Unexpected token: StartArray. Path 'queries.comments_attributes'.'."

     

    Maybe of interest is a bit further where their trying to be helpful, it says, "This is a new issue. Try posting about it on our community page—somebody may have a fix."

     

    It looks to me as if the HTTP send can't handle a json array. 

     

    Here is a screenshot of my entire flow.

    Screen Shot 2021-01-30 at 12.49.28 PM.png

     

    Here is the json I entered in the flow. (I removed the API token.) It does not make any difference if I have the dynamic content in there or not. But if I remove the entire 'comments_attributes' array, the flow works. Unfortunately, I need the array for my purpose.

    Screen Shot 2021-01-30 at 1.02.24 PM.png

     

    The following image is the error message I get when I run the flow. As you can see it never gets past parsing the json. 

    Screen Shot 2021-01-30 at 12.57.45 PM.png

  • Paulie78 Profile Picture
    8,422 Moderator on at

    For the sake of troubleshooting, I think you should put all of your values:

    organisationName, networkName etc etc into a compose step before the HTTP action. Then, in the HTTP action use the output of the compose in you inserted in the step before. Of course the result should be the same, but I am curious to see if it makes any difference and what the output of that compose turns out to be.

  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @Airneil 

     

    Thanks for the screenshot and detailed explanation. Could you try to do the same values using Postman and see if that works or not?

     

    Thanks

  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @Airneil 

     

    Could you also try the following:

     

    1. Add a compose above the HTTP action step.

    2. Construct the query JSON under the compose.

    3. Next under the HTTP action step > query parameter map the compose output using the EncodeUriComponent() expression.

     

    Thanks

  • Airneil Profile Picture
    10 on at

    Hi again,

     

    I added the compose and created the json there. It still failed...

     

    The error message is:

     

    Unable to process template language expressions in action 'HTTP' inputs at line '1' and column '2262': 'Error reading string. Unexpected token: StartArray. Path 'queries.comments_attributes'.'.

     

    Here's the flow:

    Screen Shot 2021-01-31 at 8.13.18 PM.png

     

     

  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @Airneil 

     

    Try encoding EncodeUriComponent() of compose output.

     

    Thanks

  • Airneil Profile Picture
    10 on at

    Thanks for sticking with me here. 

     

    I encoded the out put like so.

    Screen Shot 2021-02-01 at 7.03.14 PM.png

    Now when I run the flow, it fails in the same place, with a slightly different error.

    Screen Shot 2021-02-01 at 7.06.37 PM.png

     

    Between this and the last error, I think this card can't handle a json array in the query section. 

  • Airneil Profile Picture
    10 on at

    I am an idiot...

     

    I figured out that I was using the wrong section. 

     

    I am so sorry for wasting your time. 

     

    -Russ

  • Verified answer
    abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @Airneil 

     

    These things happens. Glad to hear that all sorted. 

     

    If your problem has solved, please go ahead and mark the post as solved by clicking “Accept as Solution” so that this thread will be marked for other users to easily identify!

     

    Thanks

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard