cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Microsoft karthikb
Microsoft

Handling JSON response received from HTTP GET Custom API

I have a custom API (HTTP GET) which returns data in JSON format. A part of the data returned will just be used as metadata and the rest would be values that will be put on screen. When I inspect the network calls, I can see that the JSON data is being successfully returned by the API. 

ex: 

{

"id": "58f093f48de7",

"index": 0,

"name": "test"

}

 

I tried the network call in two ways,

UpdateContext({resultJSON:GetJSONData.GetJSONData()})

and

ClearCollect(resultJSON,GetJSONData.GetJSONData())

 

How should I access the data in resultJSON?

 

I am not able to access it like resultJSON.id or resultJSON.index.

In Collections section I see the resultJSON collection with only one column 'Value' and resultJSON.value returns no data.

 

When I inspected the network calls of some sample PowerApps, there were calls to getCollectionDataSource/getColumnsAndTypes which returns the field names like 'id', 'index', 'name', etc. Is this something that I can leverage?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Handling JSON response received from HTTP GET Custom API

Hi Karthikb,

 

Could you show me more details about your Swagger file definition for a further investigation?

 

I have seen a documentation about “Customize your Swagger definition for PowerApps”, please check it for a reference:
https://powerapps.microsoft.com/en-us/tutorials/customapi-how-to-swagger/


Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Community Support Team
Community Support Team

Re: Handling JSON response received from HTTP GET Custom API

Hi Karthikb,

 

Could you show me more details about your Swagger file definition for a further investigation?

 

I have seen a documentation about “Customize your Swagger definition for PowerApps”, please check it for a reference:
https://powerapps.microsoft.com/en-us/tutorials/customapi-how-to-swagger/


Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Microsoft karthikb
Microsoft

Re: Handling JSON response received from HTTP GET Custom API

Hi,

 

Thanks for your help. I've figured out the issue and am able to use my custom API. The swagger file required additional fields defining my response data format.

The following post also was related to my issue and the solution helped.

https://powerusers.microsoft.com/t5/PowerApps-Forum/Swagger-file-definiton-for-object-array-response...

 

Thanks,

Karthik

ahetaton
Level: Powered On

Re: Handling JSON response received from HTTP GET Custom API

Hi @karthikb ,

 

How did you read the data from the JSON response?

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,938)