Hi,
I have a flow that takes new/potential customers account information, performs a http put request to check if the company has an embargo according to a website. I need the information passed back to a powerapp. Most information is there but i can't get the response status code and the body of the response into the powerapp.
I am currently storing the response in a collection in the powerapp, it is just missing status code and the body of the response.
I have been trying to change the response so that the status code is in the response json. My json knowledge is limited and my attempts lead to no information coming back to the app.
I need the response status code and body in the app so I can patch them into a CDS entity, along with other company & embargo information. Any help would be appreciated.
If you need any more information please ask.
Error
Flow on this button, data returned (no status code or response body) stored in collection and displayed in gallery on next screen
Attempt to change response JSON
Flow
Solved! Go to Solution.
I have attempted what you recommended but can't get it to work. I think the sub string function requires the length of string (which will vary based on number of results), as well as where it starts:
I think you need to trim the '{' off the front of the JSON before you add in the status code. it should read more like
{"StatusCode":200,"recordsFound":3,"matches":[...
You want the status code to be one of the fields in the JSON body.
Thanks for the reply.
How would I go about getting the first '{' out of the JSON? This is the first time I have ever worked with JSON
JSON is data represented as a string. So when you concat your new field with the existing JSON make sure to use substring() to retrieve everything except the first character. Something like this.
Concat({"StatusCode":outputs('HTTP')['StatusCode'],",",substring(body('HTTP'),1))
I have attempted what you recommended but can't get it to work. I think the sub string function requires the length of string (which will vary based on number of results), as well as where it starts:
If the substring() is requiring the third parameter you can supply that using the Length() function minus 1.
Can you point me in the direction of the Microsoft documentation on Request Response?
https://docs.microsoft.com/en-us/azure/connectors/connectors-native-reqres