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.
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
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'.
How do I properly format my code?
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
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:
After doing that, you need to put the same variable (Company from webserice URL) in the canvas PowerApps that is using this custom connector:
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
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?
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)
Here you go.
Basic info on host and base, and then params in definition url
Hi MadW
Interesting.
Can you share a screenshot of your definition of the Custom Connector?
I'm a little puzzled how this works.
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...
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
WarrenBelz
211
Most Valuable Professional
MS.Ragavendar
108
stampcoin
80