Skip to main content

Notifications

Community site session details

Community site session details

Session Id : gUVsnGKHXlNkfpiNIOQ2Nu
Power Apps - Microsoft Dataverse
Answered

Move BLOB images from MySQL to CDS

Like (0) ShareShare
ReportReport
Posted on 7 Apr 2020 12:00:57 by

Subject line says it all. I have images stored as BLOBs on a local MySQL database. I can connect to MySQL and see the images in PowerApps just fine but what I want to do is move the data from MySQL to CDS. Of course CDS images are not BLOBs. I initially wanted to do a ForAll(mysqltable, patch(cdsentity and move each record that way but CDS wants images to be records. PowerQuery didn't want to mess with them though I may have been doing something wrong. What's the best way to go about this? I have a few other ideas to plug away at but I'm hoping someone has already figured this out. Thank you very much in advance.

 

EDIT: I think I'm getting close.  I followed these instructions:

https://www.blue-granite.com/blog/simple-steps-to-embed-images-in-power-bi

 

I can convert the columns to base64 text with the jpeg url prefix but it's still a text column. In these instructions he's got a dropdown for Data Category. I can't find this dropdown. I have a dropdown for data type but there's not option for Image URL. I'm trying to find a method in the power query documentation to manually add but haven't yet. Still hoping for some help. Thanks again.

Categories:
  • Verified answer
    Community Power Platform Member Profile Picture
    on 22 Apr 2020 at 19:27:53
    Re: Move BLOB images from MySQL to CDS

    I did actually figure this out if anyone else ever tries to do the same thing. You can patch the images straight from the mysql table, forget PowerQuery for this. Treat the CDS image field as a table but feed both the .Full and the .Value properties with the same mysql binary data. 

     

    Patch(cdsTable, Defaults(cdsTable),
    
    {
    cds_image: {Full: MySQLTable.ImageCol, Value: MySQLTable.ImageCol}
    }
    )

     

    If you need to run a bunch at once use a ForAll on a keycolumn on the mysql table. If you need to do many images, I was doing 4 images per cds record, I would highly recommend patching them in with separate ForAll loops. PA was getting all choked up trying to patch in everything at once. I did an initial defaults patch to create the record with most of the text data needed then separate ForAll loops to patch in each image individually to their respective records.

  • EricRegnier Profile Picture
    8,714 Most Valuable Professional on 17 Apr 2020 at 09:21:22
    Re: Move BLOB images from MySQL to CDS

    Hi @Anonymous,

    You can have Image data type filed (in Preview) in CDS to save your image:

    https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/image-attributes

    Hope this helps

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,745 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,091 Most Valuable Professional

Leaderboard

Featured topics

Loading started