cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rena_Yu
New Member

How can I patch captured photo to image field in Microsoft Dataverse table?

I have a Dataverse Table named "Expenses". There's a "ReceiptImage" image type field.

I have a Camera Control, and a button to save the image to collection named "CapturedPhotos". See the collection structure below

Rena_Yu_0-1659706470847.png

How can I use patch function to add all photos to the dataverse table?

The current formula I am trying to use : Patch(Expenses,First(Filter(Expenses,ExpenseID=PerExpensesGallery.Selected.ExpenseID)),{ReceiptImage:Capturedphotos.Photo})

But the part in red above gives me error. 

What's the correct way to achieve this?

3 REPLIES 3
AhmedSalih
Solution Sage
Solution Sage

Hello, @Rena_Yu, Try this

 

Patch(Expenses,First(Filter(Expenses,ExpenseID=PerExpensesGallery.Selected.ExpenseID)),{ReceiptImage:{Full:Capturedphotos.Photo,Value:Capturedphotos.Photo}})

 

 

Regards,

Ahmed

If my reply helped you, please give a 👍. And if it has solved your issue, please consider a 👍 & Accepting it as the Solution to help other members of the community find it more.

My Blog: www.powerplatformplace.com

Hi Ahmed, 

 

Really appreciate your reply. I tried that but get the error below. It seems the formula recognize my Capturedphotos.Photo as a table but not a record?

Rena_Yu_0-1659742252775.png

 

Thanks,

Rena

 

I find a blog describing the possible cause: https://powerapps.microsoft.com/en-us/blog/public-preview-of-multiple-image-attributes-in-power-apps...

 

Rena_Yu_0-1659746221615.png

"it only allows a single image when used with an Image data type field. If you want multiple images per record, use either the attachment feature or create a separate table and then create a N – 1 relationship."

 

Currently, it can work if I use Camera1.Photo and Camera1.Stream. Maybe we should find a solution mentioned in this blog.

 

Thanks,

Rena

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (3,195)