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 Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (3,378)