Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mabeye09
New Member

Images from SQL Server

I have created an SQL database and tables to store images from a Powerapps application.  The images are from the camera control in Powerapps.  For testing I have both [varchar](max) and [varbinary](max) fields defined.  The app saves the images from Powerapps to SQL with no problems.

Screen Shot 2019-08-22 at 7.56.59 AM.png

 

I have a new Power BI report (lates version of Power BI Desktop) that i am connecting to this data base/table.  In the [varchar] field, Powerapps saves the image as a base64 string (data:image/png;base64,[base64text].  I also found instructions to create new column in Power Query, convert a binary data type to a base64 text file.  I have done that as well as a test to compare the original Powerapps image to the converted one.  The resulting image is exactly the same as the one created by Powerapps saved to the [varchar](max) field.  Both images can be added and display properly to a Gallery in Powerapps with no problems.

 

Screen Shot 2019-08-22 at 7.59.35 AM.png

 

I selected the Image URL data category for both fields.

 

Screen Shot 2019-08-22 at 7.57.44 AM.png

 

Finally, I added a table visual and selected the two fields.  The following is the result.

 

Screen Shot 2019-08-22 at 7.57.18 AM.png

 

I added the additional field to calculate the character length of the image field to ensure that it didn't exceed the 32,766 length limit.  Both images are under 300kb.  What have I missed?  If I publish the report to the Service, the fields are black.  I have tried this on several different computers running the lastest Power BI Desltop.  Any ideas would be greatly appreciated.

 

1 ACCEPTED SOLUTION
v-eachen-msft
Community Support
Community Support

Hi @mabeye09 ,

 

By my test, I think your images are bigger than limit.

I used a 3.66KB image(3,748 Bytes) and a 303 KB image (310,873 bytes).Here is the length in the SQL SERVER.2-1.PNG

However, when I import it and change it to be image URL, only the smaller image can appear. Then I get their lengths.2-2.PNG

You can see the length is limited to be 32766. So your image size needs to be under 32766bytes (32KB).The smaller, the better. For example, I imported a 19095-bytes image but its length is 25482-bytes in the Power BI.

 

Best Regards,

Eads

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

2 REPLIES 2
v-eachen-msft
Community Support
Community Support

Hi @mabeye09 ,

 

By my test, I think your images are bigger than limit.

I used a 3.66KB image(3,748 Bytes) and a 303 KB image (310,873 bytes).Here is the length in the SQL SERVER.2-1.PNG

However, when I import it and change it to be image URL, only the smaller image can appear. Then I get their lengths.2-2.PNG

You can see the length is limited to be 32766. So your image size needs to be under 32766bytes (32KB).The smaller, the better. For example, I imported a 19095-bytes image but its length is 25482-bytes in the Power BI.

 

Best Regards,

Eads

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

Thanks Eads,

I was using the camera on my compter to test the Powerapps app and the photos were much larger than expected.  Using the camera control on the phone, it is working perfectly.  Thanks again.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.