cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
valentinduhamel
Frequent Visitor

Getting Http response into variable using UpdateContext

Hello,

 

I'm trying to set a variable with the response of an HTTP request (custom API) using UpdateContext on a button:

valentinduhamel_0-1652706327916.png

 

The system understands the function and its response as I can pick a property from the object:

valentinduhamel_1-1652706471788.png

 

I can see on the monitor tool that when I click on the button, the HTTP request is successful:

valentinduhamel_2-1652706539118.png

But the variable is not getting the value and I'm not able to display any property of the response.

 

Any help would be much appreciate.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User
Dual Super User

Does the custom API include a JSON Schema?  or is it supposed to be inferred? In my experience loading JSON into a variable or collection only works if the explicit Schema is included in the HTTP response.  Try invoking the call using a Flow and then return it to Power Apps using an HTTP response action which includes a schema.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

4 REPLIES 4
Pstork1
Dual Super User
Dual Super User

Does the custom API include a JSON Schema?  or is it supposed to be inferred? In my experience loading JSON into a variable or collection only works if the explicit Schema is included in the HTTP response.  Try invoking the call using a Flow and then return it to Power Apps using an HTTP response action which includes a schema.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Thanks for your quick reply. Yes It's defined on the Custom API:

valentinduhamel_0-1652707644696.png

 

Yes I was thinking of using a Flow in the middle, but I was hoping not to have to use it.

 

I will give it a try.

 

That defines what is in the body, but from your screenshot in the original post it doesn't look like it supplied actual schema, just the data.  I would use Power Automate as a middleman because then you can specify the actual schema.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Thanks, it worked using Power Automate 🙂

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (1,447)