Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Connector Development
Unanswered

Power Apps Custom Connector - Return Errors

(0) ShareShare
ReportReport
Posted on by 2
Hello, 

I created a custom connector in the Power Platform and use it in Power Automate and Power Apps.
 

I created it using an ASP.NET Web API, which returns Problem Details with a Content-Type of application/problem+json, containing the error messages. In Swagger, I have the produces application/json and application/problem+json, and the schema for the Problem Details is defined in the definitions. 
 
 
In Automate, when there is a status 400 or other error codes, I can see the error messages just fine. 
 
 
However, in Power Apps, the body returns blank. Additionally, using IfError in Power Apps returns a blank value for FirstError.Details.HttpResponse. When viewing it on the Live Monitor using PowerApps, the response returns a blank body.
 

When I use DevTools, I see the Problem Details response with status 400. 


All 200 responses come through just fine. Just catching the errors that do not come through. 


I wasn't sure if I am missing some sort of connector best practice for error code returns. I couldn't find any good documentation on it. 
 

Any help is appreciated. Thank you! 


 
Categories:
  • CU04041556-0 Profile Picture
    2 on at
    Power Apps Custom Connector - Return Errors
    Hello!

    Thank you for your help! and sure thing. 
     
    My steps for creating a custom connector in the Power Platform.
    I used the Power Automate, Custom Connections route. I imported the apiDefinitions.json file using the "Import an OpenAPI file" option. Added the authentication, and made sure the yaml didn't return any errors. 
     

    The custom connector works great, but in my ASP.NET web api, I have code that throws specific errors based on validations so that it gives the end-user an idea of what they need to correct on their end. 
     
    This way, the power app developer can then throw a Notify to inform the user to make any corrections. Or, if there is a genuine issue with the internal coding, I have some information from the developer to review and inform me about potential issues.
     

    The yaml for the specific record I'm using as I troubleshoot -   
      /api/sales-record:
        post:
          tags:
            - Sales Order
          summary: Create a new sales order
          description: Create a new sales order for client
          operationId: CreateSalesOrder
          consumes:
            - application/json
          produces:
            - application/json
            - application/problem+json
          parameters:
            - in: body
              name: body
              schema:
                $ref: '#/definitions/PostSalesOrderDto'
          responses:
            '201':
              description: Created
              schema:
                $ref: '#/definitions/GetSalesOrderDto'
            '400':
              description: Bad Request
              schema:
                $ref: '#/definitions/ProblemDetails'
            '500':
              description: Internal Server Error
     
    The yaml for the Problem Details definition - 
      ProblemDetails:
        type: object
        properties:
          type:
            type: string
          title:
            type: string
          status:
            format: int32
            type: integer
          detail:
            type: string
          instance:
            type: string
        additionalProperties: false
     
     
    An example of the response:
    {
        "type": "Bad Request",
        "title": "EXISTING SALES ORDER",
        "status": 400,
        "detail": "The Sales Order is not unique. Sales Order with id S-525 exist.",
        "instance": "POST /api/sales-order"
    }
     
     
    I am not using the Code section of the custom connector options. Code Details is off.

    I made changes to the connector a few days ago. I have tested the connector using a new Power Automate flow and a new Power Apps canvas app each time I have done updates. The changes are present and working when I perform this action. 
     
     
    The only thing that is not functional is the return errors. Initially, I tested only with Automate and was able to view the error details. It wasn't until the Power Apps developer reached out to me, stating they couldn't see the error codes in their canvas app, that I began investigating why the error codes were not appearing using the IfError Power fx function.
     

    Using the Live Montitor, it shows the custom connection action as 
        Category: Network
        Result: Error 
        Result Info: Bad Request
        Status: 400
     
    But the body is blank.
     
     
    Here is the response body from the Live Monitor, I changed the guids to generic guids for purpose of pasting here:
    {
      "duration": 2813.5,
      "size": 191,
      "status": 400,
      "headers": {
        "Cache-Control": "no-cache,no-store,no-cache,no-store",
        "Content-Type": "application/problem+json",
        "Date": "Fri, 04 Apr 2025 18:22:09 GMT",
        "expires": "Thu, 01 Jan 1970 00:00:00 GMT",
        "pragma": "no-cache,no-cache",
        "ratelimit-limit": "HttpRequestRatePerPort:1500/m,ClientConnectionsPerPort",
        "ratelimit-remaining": "HttpRequestRatePerPort:1499",
        "ratelimit-reset": "HttpRequestRatePerPort:60s",
        "referrer-policy": "same-origin",
        "strict-transport-security": "max-age=31536000; includeSubDomains",
        "vssaas-request-id": "00000000-0000-4000-8000-000000000001",
        "x-content-type-options": "nosniff",
        "x-ms-apihub-cached-response": false,
        "x-ms-apihub-obo": false,
        "x-ms-dlp-gu": "-|-",
        "x-ms-dlp-re": "-|-",
        "x-ms-environment-id": "11111111-2222-4333-8444-555555555555",
        "x-ms-ratelimit-limit": 1500,
        "x-ms-ratelimit-remaining": 1496,
        "x-ms-ratelimit-reset": 0,
        "x-ms-ratelimit-used": 4,
        "x-ms-tenant-id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
        "x-report-abuse": "https://msrc.microsoft.com/report/abuse",
        "x-robots-tag": "noindex,nofollow",
        "x-served-by": "tunnels-prod-rel-usw3-v3-cluster",
        "x-ms-client-request-id": "99999999-8888-7777-6666-555555555555"
      },
      "body": "",
      "responseType": "text"
    }
     
     
  • Michael E. Gernaey Profile Picture
    39,785 Super User 2025 Season 1 on at
    Power Apps Custom Connector - Return Errors
     
    Can you please share the steps you used to create it (since there are many).
     
    Also, can you please share your JSON for your responses? I want to make sure they are consumable.
     
    Are you using any custom code?
     
    Also, have you done any updates to this Connector? If so, you should disconnect it and reconnect it to your app and this may resolve it.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,518 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,756 Most Valuable Professional

Leaderboard

Featured topics