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.
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.
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
WarrenBelz
146,745
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,091
Most Valuable Professional