Showing results for 
Search instead for 
Did you mean: 
Helper I
Helper I

JSON format not correct

I was able to call my WCF service from a stream. I now have the following problem.
My WCF service returns a JSON that I believe is correctly formatted and in other applications that call it I have no problem as I can extract the result object from the response which contains only the Json.
When I call the service from my flow what I receive in output is not a clean Json but the body that contains the Json inside.
I guess this is why from Power apps when I try to run the () command it tells me that the JSON is incorrect.
How can I isolate the result from the Body? Below you can see the output of mi HTTP request




    "BANFN": "5000003823",
    "BNFPO": "00010",
    "TXZ01": "GIGASET A540 VOIP",
    "ERNAM": "RLEWIN",
    "MENGE": "       5.000",
    "EKGRP": "N16"

Accepted Solutions

Unfortunately, there's no built in way to convert JSON to a collection.

Perhaps you could use one of the workarounds that are mentioned here?


View solution in original post

Super User
Super User

Hi @Citrix73 

With this example result from your WCF service, you can isolate the JSON content by searching for the positions of the { and } characters. You can then call the mid function to retrieve the content between these two characters.

You can then call the plaintext function to unencode the output.

Here are the formulas to store the input values in variables.

"<s:Envelope xmlns:s=""""><s:Body><visualizza_lista_rda_jsonResponse xmlns=""http://...;
    ""BANFN"": ""5000003823"",&#xD;
    ""BNFPO"": ""00010"",&#xD;
    ""TXZ01"": ""GIGASET A540 VOIP"",&#xD;
    ""ERNAM"": ""RLEWIN"",&#xD;
    ""MENGE"": ""       5.000"",&#xD;
    ""EKGRP"": ""N16""&#xD;

"{", varWsOutput));

"}", varWsOutput))

The following formula will return the JSON content.






Thanks Timl,

excuse me but i'm novice on powerapps.

Where i have to insert these formulas?

I use a Flow to call the wcf service. It's scorrect? In image Below you can see my call.

I take this opportunity for ask you how can i dinamically set the parameters of request.

As you can see in attachment now i call the service copying in the body of request all the query parameters.

Thanks a lot





I think that i am near the solution.

with your help now i have isolated the clear json

With the formula that you suggest i have a variable vith the clear Json but if i try to populate a collection with this variable it seem not recognize the json but a single text as you can see in the secon screenshot where you can see the collection that i want to connect to my vertical gallery. How can i populate correctly the collection? Please





Unfortunately, there's no built in way to convert JSON to a collection.

Perhaps you could use one of the workarounds that are mentioned here?


Your help has been invaluable.
I populated the collection although I had to make some corrections to your formula as using the mid function with start and end {} the resulting variable was only the first record of the Json. Therefore using [] instead the result is all the complete Json that you see below.
Now I have another problem using the workaround you suggested to load the collection from the Json and passing it this Json always returns me only the first record in the collection.
I have created a flow as described in workarond that you suggest me that parse this Json but the result is only first record.
Where is the problem? Below i attached also the screenshot of my flow to convert JSON to Collection
Thanks a lot


"BANFN": "5000003840",
"BNFPO": "00010",
"TXZ01": "BROTHER 2710 DN",
"MENGE": " 1.000",
"EKGRP": "N16"
"BANFN": "5000003843",
"BNFPO": "00010",
"MENGE": " 1.000",
"EKGRP": "N16"
"BANFN": "5000003843",
"BNFPO": "00020",
"TXZ01": "GIGASET A170",
"MENGE": " 1.000",
"EKGRP": "N16"
"BANFN": "5000003842",
"BNFPO": "00010",
"MENGE": " 1.000",
"EKGRP": "N16"









Excuse me.


The Json schema was not correct

Helpful resources

Ignite 2022


Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,020)