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

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (96,315)