cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Microsoft
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
Community Support

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
Community Support

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

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

Helper I
Helper I

Hi @karthikb ,

 

How did you read the data from the JSON response?

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (5,575)