cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jiwanovski Advocate II
Advocate II

Image conrol not showing image

Hi everybody,

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 "content@odata.mediaEditLink" 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):

MyCustomConnector.Pictures("companies(3b710677-bc7a-4328-b9fc-85831f60fd49)").'content@odata.mediaReadLink'

 

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 content@odata.mediaReadLink 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?

 

5 REPLIES 5
Community Support
Community Support

Re: Image conrol not showing image

Hi @jiwanovski 

 

Could you please share more details of your cusomer connector?

Do you have the issue now?And could you please share screenshot of the issue?

 

Best Regards.

Yumia

jiwanovski Advocate II
Advocate II

Re: Image conrol not showing image

@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:

2019_06_26_08_52_49_CustomConnectorTest_Gespeichert_nicht_veröffentlicht_PowerApps.pngreference directly to value of result from custom connector is showing image...2019_06_26_08_48_15_CustomConnectorTest_Gespeichert_nicht_veröffentlicht_PowerApps.pngAccress in Powerapps to the result of custom connector2019_06_26_08_44_53_PowerApps.pngScreenshot from Test in custom connector2019_06_26_08_41_10_Postman.pngScreenshot from Postman result

jiwanovski Advocate II
Advocate II

Re: Image conrol not showing image

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?

PowerApp12
New Member

Re: Image conrol not showing image

Hi @jiwanovski,

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.

Thank you.

EtienneFr
Frequent Visitor

Re: Image conrol not showing image

Hi,

 

Facing same issue,

 

Here is my solution,

 

First locate the full API url up to the /content segment in Postman.

Picture API.png

 

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.

 

 

CustomConnector.png

You should also define the Response in order that returned type is set as String/Binary

schema property.png

 

In Powerapps call the custom connector to collect content in a collection.

 

collect.png

 

Then in your gallery define the collection as Items and set the image property of your gallery item to "Url".

 

Gallery.png

 

Hope this helps,

 

 

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (6,899)