cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
karthikb
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
v-yamao-msft
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
v-yamao-msft
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

ahetaton
Helper I
Helper I

Hi @karthikb ,

 

How did you read the data from the JSON response?

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,346)