Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 4NtngCTviFgmibndDSfZm4
Power Apps - Building Power Apps
Unanswered

404 error trying to consume custom connector for Business Central

Like (1) ShareShare
ReportReport
Posted on 4 Nov 2019 15:18:38 by 11

I've created a Postman collection to represent a custom OData API that we have published for Business Central.

 

I uploaded this Postman collection to the Custom Connector builder and this correctly created my OpenAPI spec file. The request/response have been correctly defined and I can test my API via the test tool (screenshot attached).

 

I've tried with both basic and OAuth2.0 authentication and whilst both work in Postman and in the API test tool within the Custom Connector builder, these do not work in the PowerApp.

 

I've also tried with a simple public API that returns some basic JSON - this requires no authentication and this works correctly in the PowerApp.

 

Whenever I consume the Custom Connector via the app builder I get a 404 error (also attached).

 

I've tried this with parameters, without parameters, with different authentication methods etc etc, no matter what I do I can't get PowerApps to talk to a custom BC OData API.

 

I'm baffled as to why I get a 404 - though I notice that if I try to call my API after leaving one of the parameters blank in the test tool I also get a 404 in the response, so I have a gut feeling this may be related to request parameters.

 

Has anyone had this issue/seen this working? I can't use the out-of-the-box BC connector as it doesn't support custom APIs.

  • Marcel Lathouwers Profile Picture
    236 on 24 Aug 2023 at 07:58:18
    Re: 404 error trying to consume custom connector for Business Central

    You probably found out by now, but the response is probably an object. The table is part of that object and can be retrieved by adding '.value' at the end of your statement

  • Community Power Platform Member Profile Picture
    on 02 Jul 2021 at 17:05:51
    Re: 404 error trying to consume custom connector for Business Central

    Hi Ilija -

     

    Your suggestion has helped with my issue, however I am still unable to properly consume my BC custom connector to a powerapps gallery. My connector is titled JobJournal, and the function is GetJournal.

     

    JobJournal.GetJournal("29794d-9ebb-492c-befd-f8fb507c0869","Production","'WOLF%20Set'")

     

    This code is no longer 404ing, but now I receive the error 'expected table value'.

     

    KyleH_0-1625245475656.png

     

    How do I properly format my code?

  • Bart_4PS Profile Picture
    4 on 17 Jun 2021 at 12:36:12
    Re: 404 error trying to consume custom connector for Business Central

    Hi @MadW ,

     

    I've found a possible sollution for this. I got the custom connector working in combination with Business Central Onprem. I've publisched an custom API page using the webservices.xml file in the AL extension. THis one worked in Postman but as you found out not in PowerApps.

     

    Finally i've found the issue, it's in the basepath and the action Path. The action path should only contain 1 section for example /Page. The basepath should contain all other sections of information like <NST>/api/<APIPublisher>/<APIGroup>/<APIVersion>/companies(<companyid')

     

    Then it worked for me. 

     

    Regards,

     

    Bart

  • Community Power Platform Member Profile Picture
    on 31 Mar 2021 at 00:07:56
    Re: 404 error trying to consume custom connector for Business Central

    Hi BC / Power Platform cohort.

     

    I faced with the same challenge, custom D365 BC PowerApps connector is working perfectly while testing and using swagger editor, also in Postman, but it is not working in canvas PowerApps.

     

    Luckily, I have managed to find the workaround. The issue is that Canvas PowerApps is expecting a string in the function calling D365 BC custom connector. Because of that, the variable must be inserted instead of copy/paste of webservice URL in the D365 BC custom connector request:

    Ilija_Pesic_0-1617148896776.png

    After doing that, you need to put the same variable (Company from webserice URL) in the canvas PowerApps that is using this custom connector:

    Ilija_Pesic_1-1617149070370.png

    When canvas PowerApps on top of D365 BC custom connector is built like this, PowerApps will work. 

     

    I am at your disposal for any further questions. Hope this reply will help to make your PowerApps live. 🙂

     

    Kind regards,

     

    Ilija Pesic

     

  • MadW Profile Picture
    77 on 03 Sep 2020 at 08:27:47
    Re: 404 error trying to consume custom connector for Business Central

    Hi,

     

    I am completely sure it is working in PowerApp. Colors are "flow like" because I added connector to my solution, and some how it shows Flow colors when navigating to solution...

     

    Maybe you could share a screenshot from your connection?

  • HenrikMB Profile Picture
    21 on 01 Sep 2020 at 11:00:53
    Re: 404 error trying to consume custom connector for Business Central

    Hi MadW

     

    I have some problems doing the same, to get some data back. 

     

    Are you sure you have done this example in PowerApps and not in Flow. The colors looks like

    the standard colors from the Flow development tool ?

    (In Flow it works, but not in PowerApps)

     

  • MadW Profile Picture
    77 on 31 Aug 2020 at 08:38:47
    Re: 404 error trying to consume custom connector for Business Central

    Here you go.

    Basic info on host and base, and then params in definition url 

    CustomConnect_HostBase.pngCustomConnect_Definition.png

  • HenrikMB Profile Picture
    21 on 28 Aug 2020 at 06:43:35
    Re: 404 error trying to consume custom connector for Business Central

    Hi MadW

     

    Interesting.

     

    Can you share a screenshot of your definition of the Custom Connector?

     

    I'm a little puzzled how this works.

  • MadW Profile Picture
    77 on 27 Aug 2020 at 17:23:50
    Re: 404 error trying to consume custom connector for Business Central

    Hi,

    I got at little help to find a way. So now it's working \o/

    You cannot have tenantid or companyid as part of the url in the custom connector. These must be variables.

    When I call my custom connector function, I call them like this:

    ClearCollect(collCustomers,myCustomConnector.GetCustomerItems("1111111-aaaaaaa-22222222-bbbbb", "Production","5e201ae1-88d1-ea11-bb55-000d3a228e0e"))

    Parameter 1 is tenantid, 2 is environmentname and 3 is companyid.

    A lesser ugly way of calling it is to store these values in global parameters and use them in app. Maybe there's even a prettier way, to maybe provide them like username and password...

  • HenrikMB Profile Picture
    21 on 26 Aug 2020 at 13:57:21
    Re: 404 error trying to consume custom connector for Business Central

    Hi

     

    I don't think there is any solution to the problem right now.

     

    The standard connector works with standard endpoint, yes but there are very few standard endpoints, so to work with

    PowerApps that connect to Business Central is very very very limited.  

     

    But people can vote up the request to Microsoft, that the Standard Connector can be extended with custom APIs like it is on the Dynamics NAV standard connector.

    https://experience.dynamics.com/ideas/idea/?ideaid=e0d0a4f9-5467-e911-b047-0003ff68932e

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

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,668 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard