cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
TonyHart
Level 8

Patch Updates with Picklists & Media

Hello,

I have an entity from the CDS that I want my users to be able to update via the Patch() command. In this entity I have fields types such as Text, Picklists, Images, Emails, Phone Numbers, etc.

 

I am having issues with updating my Images & Picklists with the Patch command. I have tried Patch(Person, BrowseGallery_PersonList.Selected, {Name:DataCardValue_PersonImage.Media}) for my image, and I honestly have no idea what to try for my Picklists (.Text doesn't work). 

 

Are these functions allowed with Patch? If so, how can I implement them?

2 ACCEPTED SOLUTIONS

Accepted Solutions
mr-dang
Level 10

Re: Patch Updates with Picklists & Media

Images have returned as an available field in CDS--it seems the PA team was reworking it.

 

Perhaps you are not referencing images correctly in your formula for Patch().

 

In my experience, I have found that fields of the Image type must cite an image blob. This means that if you wanted to patch a URL of an image as an image, it would be incompatible because it counts as text. It is also not possible to Patch Camera1.Image for some reason, but a collection is better anyway.

 

Here's what I've found in my bugging:

  • Patch Camera images by collecting them to a Collection upon selecting the camera control (taking a picture): First(Filter(collectionname,[conditions go here])).Image
  • Patch images uploaded with the AddMediaButton as AddMediaButton1.Media
  • Patch PenInput ink as PenInput1.Image

URLs must be Patched to fields restricted to text or URLs.

Microsoft Employee
@8bitclassroom

View solution in original post

TonyHart
Level 8

Re: Patch Updates with Picklists & Media

@mr-dang,

Nevermind, I solved my problem. In order to Patch() with a Picklist you need to update the value with the following command:
Patch( source, record, {field: DataCardValue.Selected.Value} )

View solution in original post

3 REPLIES 3
mr-dang
Level 10

Re: Patch Updates with Picklists & Media

Images have returned as an available field in CDS--it seems the PA team was reworking it.

 

Perhaps you are not referencing images correctly in your formula for Patch().

 

In my experience, I have found that fields of the Image type must cite an image blob. This means that if you wanted to patch a URL of an image as an image, it would be incompatible because it counts as text. It is also not possible to Patch Camera1.Image for some reason, but a collection is better anyway.

 

Here's what I've found in my bugging:

  • Patch Camera images by collecting them to a Collection upon selecting the camera control (taking a picture): First(Filter(collectionname,[conditions go here])).Image
  • Patch images uploaded with the AddMediaButton as AddMediaButton1.Media
  • Patch PenInput ink as PenInput1.Image

URLs must be Patched to fields restricted to text or URLs.

Microsoft Employee
@8bitclassroom

View solution in original post

TonyHart
Level 8

Re: Patch Updates with Picklists & Media

@mr-dang,

 

Thanks for the help. Apparently I was just referencing the wrong field. But I am still having issues when it comes to my Picklists working at all. Do you have any help on that one?

TonyHart
Level 8

Re: Patch Updates with Picklists & Media

@mr-dang,

Nevermind, I solved my problem. In order to Patch() with a Picklist you need to update the value with the following command:
Patch( source, record, {field: DataCardValue.Selected.Value} )

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (1,702)