web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patch image to CDS ent...
Power Apps
Answered

Patch image to CDS entity record

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I've created a CDS entity "picList" with two columns, one for Part Numbers, populated with unique part numbers, and one for Images. Images column is empty, assigned data type of image. In a canvas powerapp I have a gallery fed from this entity, I have a button, and I have a camera control. What I want to do is select a part number from the gallery then take a picture and save it to the Image column. Below is what I have for the button's OnSelect:

 

Patch(picLists,First(Filter(picLists,PartNums = Gallery2.Selected.PartNums)), {Image: Camera1.Photo});

 

This approach doesn't seem to be working. I'm hoping someone can steer me in the right direction. I'm worried that my concept of what CDS is and what it can do is all wrong. Thanks in advance.

I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @Anonymous 

    This is an old post but I have been looking into this issue.  At the present time, it appears that the only reliable way to get an image into an entity is using an edit form and submitting it.  I can't see that anyone has been successful at using a Patch() to get an image into an entity. The other alternative is to add the image as an attachment. 

  • Verified answer
    TaxusLapis Profile Picture
    29 on at

    Hi @Drrickryp , I found a way that works for me, posted it in another thread though, but here it goes again: 

    I was facing the same problem, but seem to have found the solution:
    As Powerapps states you need a record to patch the CDS entity. My Patch statement now looks like this and it works like a charm:

    ForAll(objPixCentral, Patch(objectPictures,Defaults(objectPictures),{img_Object:{Full:picObj,Value:Pic} }))

    To have it look more like a template:
    ForAll([yourCollection],Patch([your entity],Defaults([yourentity]),{[your image field in the entity]:{Full:[your camera.photo value], Value:[your camera.stream value]}}))

    EDIT: 
    turns out it is sufficient ot put the same value in both columns within the patch statement, no need to put in the camera.photo and the camre.stream

  • CyberTentmaker Profile Picture
    5 on at

    Thank you so much! This worked for me when having to patch images in a collection to a Table in Dataverse.

  • Avinoam Profile Picture
    53 on at

    Actually it is totally sufficient to only determine the "Value" property, leaving out the "Full" property.

    To summarize this solution I'd put things so:

    • when CREATING a record with image patching - use {Value:[your image.image]} 
    • when UPDATING a record with image patching - use {Value:[your image.image]} 
    • when DELETING a record with image patching - use {Value: Blank() , Full: Blank()} 
  • Ronak83garg Profile Picture
    117 on at

    Hi @CyberTentmaker ,

     

    I have the same requirement to push the images from powerapps to Dataverse table with Image as the column Datatype and later on retrieve the first image out of it.

    Can you please suggest how you made it work ?

     

    Thanks in advance.

  • Avinoam Profile Picture
    53 on at

    I eventually dropped the whole concept of saving images in Dataverse all together, because it seems to have limits on the size of the image and the whole i/o process of images-Dataverse doesn't seem too native.

    Instead I went to the native and natural place for storing images - SharePoint Library.

    It's a little learning curve to get the concept of how things are stored in SP, but once you get it - it's stable, accepting, and precise.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 335 Most Valuable Professional

#2
11manish Profile Picture

11manish 166

#3
sannavajjala87 Profile Picture

sannavajjala87 71 Super User 2026 Season 1

Last 30 days Overall leaderboard