cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vshets
Level: Powered On

Images not loading from Azure SQL DB Data Source

Hello,

 

I uploaded an image from PowerApp using the `Add Picture` and the attachment stores in the Azure SQL server as attached. The `attachment` column is of type varbinary(max). When I try to read back the image from the SQL Server into PowerApps, I get a blank screen. Any idea why it is unable to display the image?

Screen Shot 2018-11-27 at 4.47.22 PM.png


In my app, I am attempting to display images using for example this query:

LookUp('[dbo].[employee_table]',id=7068,attachment)

but all I get is a blank image.

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
vshets
Level: Powered On

Re: Images not loading from Azure SQL DB Data Source

In the end, the images started showing up in the app. One reason could be because I increased the spec of our Azure SQL server to now have 4 cores from 1 core at a whooping cost, the time to load the images was much shorter. It might have been the case that the images took forever to load - which is unreasonable TBH especially if the image size is < 20KB. 

Also note that the data type for images, can be `varbinary(max)` instead of the soon to be deprectaed `image` type. Since this worked for me.

5 REPLIES 5
Community Support Team
Community Support Team

Re: Images not loading from Azure SQL DB Data Source

Hi @vshets

How do you upload a image file from your app to your Azure SQL Server using "Add Picture" control?

How do you display the images (binary data) within your app? Using Image control?

If you want to display the binary image data from your Azure SQL table within an app, I afraid that there is no way to achieve your needs in PowerApps currently.

Displaying a binary image value within Image control is not supported within PowerApps currently. As an alternative solution, you could consider take a try to create Image type column within your SQL table to store the Uploaded image.

Please check and see if the following blog would help in your scenario:

https://powerapps.microsoft.com/en-us/blog/upload-files-from-powerapps-to-sql-server/

After that, you could display the uploaded image within the Image control as below:

LookUp('[dbo].[employee_table]',id=7068, ImageColumn)

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
vshets
Level: Powered On

Re: Images not loading from Azure SQL DB Data Source

Hi Kris,

 

Thank you for coming back. From this link, it looks like image data type will be deprecated:
"IMPORTANT! ntexttext, and image data types will be removed in a future version of SQL Server. Avoid using these data types in new development work, and plan to modify applications that currently use them. Use nvarchar(max)varchar(max), and varbinary(max) instead."

 

I have used that blog you mentioned to build a solution and it worked perfectly for a while .. only I did not use the image data type for the reasons stated above.

I have used the varbinary data type before and it displayed the images in PA before but stopped working when I checked a few days back.

 

Please advise.

 

Thanks!


vshets
Level: Powered On

Re: Images not loading from Azure SQL DB Data Source

Hi @v-xida-msft .. I changed the column type to Image and uploaded new images. But I am having the same problem of blank images. The Image is still being stored as a binary data though (as expected?). Tested with an image gallery as well. Increased the DTUs from 100 to 200 . Nothing seems to have worked. It used to work before but something has changed that is preventing this from working correctly. Please help as we will be releasing the app to 100s of users. 

 

This is what I see when I read from the database as a collection:
Screen Shot 2018-12-05 at 5.42.05 PM.png

vshets
Level: Powered On

Re: Images not loading from Azure SQL DB Data Source

In the end, the images started showing up in the app. One reason could be because I increased the spec of our Azure SQL server to now have 4 cores from 1 core at a whooping cost, the time to load the images was much shorter. It might have been the case that the images took forever to load - which is unreasonable TBH especially if the image size is < 20KB. 

Also note that the data type for images, can be `varbinary(max)` instead of the soon to be deprectaed `image` type. Since this worked for me.

Highlighted
mgesualdo
Level: Powered On

Re: Images not loading from Azure SQL DB Data Source

Hi there! I had a similar issue when storing images in azure sql, and I finally decided to move the images to sharepoint and now my app is working much faster! I you keep with this problem just let me know, and I'll tell you what I did.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 30 members 4,235 guests
Please welcome our newest community members: