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

Custom Connectors - Access Response Body when POST

Hello!

I could not find information about this, so here goes nothing.

 

I've got a custom connector, which I'm using in powerapps to create information in $system, via POST method.

The method itself works correctly, and I can see everything is showing up in $system as intended. 

With the monitor, I can see the request go out, and receive the appropriate response (HTTP 200 with a JSON body).

 

Here's my issue: I need to know, in app, when that HTTP 200 arrives (or access the body of the response, which has that info), because it'll be a trigger to take some actions.

I've tried to wrap my call to the connector with IfError, but sometimes it'll throw an error, even tough the response is OK and no error shows up in the monitor.

 

Thanks in advance!

 

 

3 REPLIES 3

@gberta1 

 

If you want to use Error, IfError, IsError, or IsBlankOrError functions you should make sure the Settings -> Upcoming Features -> Preview -> Formula-level error management settings is turned on for these functions to do anything when used in your Power App.

poweractivate_0-1664838760107.png

Check if it helps @gberta1 

I'm fully aware of that option. It's enabled for all my apps. It does not solve the problem in the post.


@gberta1 wrote:

Here's my issue: I need to know, in app, when that HTTP 200 arrives (or access the body of the response, which has that info), because it'll be a trigger to take some actions.

I've tried to wrap my call to the connector with IfError, but sometimes it'll throw an error, even tough the response is OK and no error shows up in the monitor.

 

Thanks in advance!

 

 


Could you clarify what you are trying to do?

Also you could check some details in my response here

Checking for errors on an API call through a custom connector 

 

You just make a call to the custom connector from Power Apps Canvas App and the data should be there.

 

IfError will only catch internal errors actually. For anything else, the HTTP status code your API should be returning, is 200 - including for errors as well, in an error message if necessary handled through the Canvas App to check if the error field is present or some way like that. If the status code is not 200, this kind of API will not work for Custom Connector for your use case because it will retry the connection instead of pass it through. 

 

Assuming you are always having HTTP 200 - what is the issue?

If you are trying to take action, the issue may be with the formulas in your app that are accessing the response data and trying to take action. For this, please check on it, and see if you could provide more information or the formulas to see if there is some issue there. Even if an error is not shown, maybe the formulas need to be adjusted as they may be doing nothing or silently failing, or otherwise behaving in a way you are not expecting. 

 

See if it helps to clarify it @gberta1 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

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