cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
mabeye09 Frequent Visitor
Frequent Visitor

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

Accepted Solutions
Community Support Team
Community Support Team

Re: Images from SQL Server

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
Community Support Team
Community Support Team

Re: Images from SQL Server

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

mabeye09 Frequent Visitor
Frequent Visitor

Re: Images from SQL Server

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
Coming Soon: T-Shirt Design Contest

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors
Top Kudoed Authors