cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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!


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.


All Replies
Community Support Team Rank
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

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.