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 Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (34,988)