cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
aec2018
Microsoft
Microsoft

How can I show a successful custom connector HTTP response in my canvas app?

I have a PowerApps canvas app with a screen containing a grid where users can do two things to each item: update the status of the item or mark the item as resolved. Each row on the grid has a "save updated status" and "resolve" icon. When clicked, they don't leave the page. Each icon makes an API call using our custom connector. (We're not using a Flow.) Because they're not leaving the page, I would like to use the Notify() function to show that the API accepted the status update or the resolved item. How can I display this to the user with the API's successful response?

1 ACCEPTED SOLUTION

Accepted Solutions

@aec2018 I'll admit, haven't used GraphQL, but Google says for the error handling in GraphQL, when an error occurs, the server must add an "error" entry in the response.

So you can see if that's returned for you. If nothing else,as you said, you could always infer from the info that's received. Sorry I couldn't be more helpful.

View solution in original post

3 REPLIES 3
jatcube
Solution Supplier
Solution Supplier

@aec2018 when you created the custom api connector, you were given the option to specify the response and the response body. With the intellisense in PowerApps you can set the notify value to the response returned.

For reference:

https://docs.microsoft.com/en-us/connectors/custom-connectors/define-blank 

https://powerusers.microsoft.com/t5/Building-Power-Apps/Display-Internet-Based-Time/td-p/598253/high... 

 

hope that helps

@jatcube I appreciate the help. A few questions, though. Our API is GraphQL based so all of our requests are POST. I use the default response value in the custom connector to define the shape of the data that we'll get back when retrieving data to display. When submitting a mutation, GraphQL responds with the item that was updated/saved. So I wouldn't have a property explicitly saying that a response was successful. I would only have access to the body, correct? Not the HTTP header with the response code? And if so, I'm guessing that I would then have to use some logic to infer a success? Such as just looking for the ID in the update response that was used in the update request?

@aec2018 I'll admit, haven't used GraphQL, but Google says for the error handling in GraphQL, when an error occurs, the server must add an "error" entry in the response.

So you can see if that's returned for you. If nothing else,as you said, you could always infer from the info that's received. Sorry I couldn't be more helpful.

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.

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 (5,749)