cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Lexicron
Resolver II
Resolver II

How to upload a photo to a custom image field in a CDS entity? What is the difference between having a custom image field and using the Attachment control?

I have a CDS entity. It has a field named ReceiptImage. It is of image type. In my app I have a form that lets users upload a photo (just one) to the ReceiptImage field, but the photos aren't saving/uploading.

 

I hear there is an Attachment control but it doesn't seem to be an actual field in my CDS entity. Am I supposed to use the Attachment control in my Powerapps form to get the image from the user into the app, and then transfer that image from the Attachment control to the ReceiptImage field I actually want populated? 

 

How do I get this to work please?

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @Lexicron ,

Do you want to update an image type field in entity?

Firstly, let me tell you the differences between the image field and Attachments.

Each entity has a metadata field called Attachments, which generated by system.

This field is updated by Attachments control inside a form.

And this field's data is stored in Note entity, not current entity.

While image type field is a custom field created manually.

This field could be updated by Image control, camera control, add picture control.

This field data could only be seen in powerapps.

 

I've made a similar test for your reference:

1)penimage is my image field

testmanies is my entity name

2)insert an add picture control

insert a submit button

3)set the submit button's OnSelect:

Patch(testmanies,Defaults(testmanies),{penimage:UploadedImage1.Image})

4148.PNG

 

4)To view this field, you just need to insert a gallery, set the gallery's Items to this entity.

set an image control 's Image inside the gallery:

ThisItem.penimage

 4149.PNG

 

 

Best regards,

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

View solution in original post

1 REPLY 1
v-yutliu-msft
Community Support
Community Support

Hi @Lexicron ,

Do you want to update an image type field in entity?

Firstly, let me tell you the differences between the image field and Attachments.

Each entity has a metadata field called Attachments, which generated by system.

This field is updated by Attachments control inside a form.

And this field's data is stored in Note entity, not current entity.

While image type field is a custom field created manually.

This field could be updated by Image control, camera control, add picture control.

This field data could only be seen in powerapps.

 

I've made a similar test for your reference:

1)penimage is my image field

testmanies is my entity name

2)insert an add picture control

insert a submit button

3)set the submit button's OnSelect:

Patch(testmanies,Defaults(testmanies),{penimage:UploadedImage1.Image})

4148.PNG

 

4)To view this field, you just need to insert a gallery, set the gallery's Items to this entity.

set an image control 's Image inside the gallery:

ThisItem.penimage

 4149.PNG

 

 

Best regards,

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

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,894)