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
Solved! Go to Solution.
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
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogHi
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.
Thanks
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogHi 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.
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.
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.
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.
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
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogHi @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
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogHi 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:
Hi @Airneil
Try encoding EncodeUriComponent() of compose output.
Thanks
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogThanks for sticking with me here.
I encoded the out put like so.
Now when I run the flow, it fails in the same place, with a slightly different error.
Between this and the last error, I think this card can't handle a json array in the query section.
I am an idiot...
I figured out that I was using the wrong section.
I am so sorry for wasting your time.
-Russ
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
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogThe first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
66 | |
23 | |
17 | |
16 | |
13 |
User | Count |
---|---|
117 | |
35 | |
32 | |
28 | |
26 |