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 flow.run () 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
Thanks
Solved! Go to Solution.
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?
https://powerusers.microsoft.com/t5/Building-Power-Apps/Parse-JSON-string-in-Power-APPS/td-p/381832
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.
https://docs.microsoft.com/en-gb/powerapps/maker/canvas-apps/functions/function-left-mid-right
You can then call the plaintext function to unencode the output.
Here are the formulas to store the input values in variables.
Set(varWsOutput,
"<s:Envelope xmlns:s=""http://schemas.xmlsoap.org/soap/envelope/""><s:Body><visualizza_lista_rda_jsonResponse xmlns=""http://...;
{
""BANFN"": ""5000003823"",
""BNFPO"": ""00010"",
""TXZ01"": ""GIGASET A540 VOIP"",
""ERNAM"": ""RLEWIN"",
""MENGE"": "" 5.000"",
""EKGRP"": ""N16""
}
]</visualizza_lista_rda_jsonResult><uid>fcedrini</uid><pwd>pascol</pwd></visualizza_lista_rda_jsonResponse></s:Body></s:Envelope>");
Set(varStart,
Find(
"{", varWsOutput));
Set(varEnd,
Find(
"}", varWsOutput))
The following formula will return the JSON content.
PlainText(Mid(varWsOutput,
varStart,
(varEnd-varStart)+1)
)
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?
https://powerusers.microsoft.com/t5/Building-Power-Apps/Parse-JSON-string-in-Power-APPS/td-p/381832
{
"BANFN": "5000003840",
"BNFPO": "00010",
"TXZ01": "BROTHER 2710 DN",
"ERNAM": "RLEWIN",
"MENGE": " 1.000",
"EKGRP": "N16"
},
{
"BANFN": "5000003843",
"BNFPO": "00010",
"TXZ01": "SWITCH 8P NETGEAR",
"ERNAM": "RLEWIN",
"MENGE": " 1.000",
"EKGRP": "N16"
},
{
"BANFN": "5000003843",
"BNFPO": "00020",
"TXZ01": "GIGASET A170",
"ERNAM": "RLEWIN",
"MENGE": " 1.000",
"EKGRP": "N16"
},
{
"BANFN": "5000003842",
"BNFPO": "00010",
"TXZ01": "SWITCH UNIEURO 5 P",
"ERNAM": "RLEWIN",
"MENGE": " 1.000",
"EKGRP": "N16"
}
Excuse me.
Resolved.
The Json schema was not correct
User | Count |
---|---|
125 | |
87 | |
86 | |
75 | |
69 |
User | Count |
---|---|
216 | |
181 | |
140 | |
97 | |
83 |