we are using Microsoft Business central and try to create an PowerApp Canvas with some data.
Therefore we have created a custom connector and this is working (tested with Postman and tested results in custom connector directly). This is also working for regular Entities like Items etc.
But we also want to show some images in the PowerApp which are stored in Business Central. Business Central also provides a standard API to get these Images (see: : https://docs.microsoft.com/en-us/dynamics-nav/fin-graph/api/dynamics_picture_get).
The result of this API is showing in Postman is showing a field "email@example.comEditLink" with a value to the image. Example (without correct address) "https://myBusinessCentralAddress:7048/BC130/api/beta/companies(3b710677-bc7a-4328-b9fc-85831f60fd49)/items(22155d5a-593e-4c8a-bdc9-3b8b9a14c0ba)/picture(22155d5a-593e-4c8a-bdc9-3b8b9a14c0ba)/content"
Now I try to put this information as source into the image control like (information of item and picture is hardcoded in postman to test):
In PowerApps I get the following error message:
Status Code: 404 Message: Resource not found
When I just try to use the value ("https://myBusinessCentralAddress:7048/BC130/api/beta/companies(3b710677-bc7a-4328-b9fc-85831f60fd49)/items(22155d5a-593e-4c8a-bdc9-3b8b9a14c0ba)/picture(22155d5a-593e-4c8a-bdc9-3b8b9a14c0ba)/content") of the firstname.lastname@example.orgReadLink from Postman and put this direcly into the source of the Image control, the image control is showing the image correctly.
So what can I do, to use the value from my custom connector?
@v-yuxima-msft which information do you need?
When I just do the test on custom connector itself, I get the same result than in Postman.
So I believe the custom connector is okay. I believe there have to be something changed on PowerApps....
Here are some Screenshots:
I just have recognized following:
When I first test this link (result from custom connector) directly in my browser, I need to authenticate. Then I put this link into PowerApps Designer in the image control and it is visible (all directly - no custom connector).
So I wonder: When I take the link from the connector, I may have to do the authentication another time (the connector itself need to authenticate itself, but accessing the link from custom connector result needs it too. So the credentials are the same.
So what I believe right now: When I do all this on my browser directly without custom connector, this is running because I have signed to this link one time with browser and the browser is saving this information und takes it for the tab of PowerApps Designer too...
When I take the CustomConnector he wants me to do another authentication.... My Custom Connector do have the credentials for the API call itself but it is not using these credentials to accress the link from the result... Can this be solved directly in my CustomConnector?
Is this understandable?
It 's been a long time from your last comment, so I wonder if you have solution for this issue cause i have same question like you too.
If you have any solution to show the image from BC to Image control please share with me.
Facing same issue,
Here is my solution,
First locate the full API url up to the /content segment in Postman.
Then build a Custom Connector where you call the picture api up to to the /content segment and define the companyid, itemid and picture id as parameters.
You should also define the Response in order that returned type is set as String/Binary
In Powerapps call the custom connector to collect content in a collection.
Then in your gallery define the collection as Items and set the image property of your gallery item to "Url".
Hope this helps,