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 / Canvas app: Patch func...
Power Apps
Unanswered

Canvas app: Patch function with dropdown of CDS field items

(0) ShareShare
ReportReport
Posted on by

Hi everyone.

So I want to take a picture with the camera, select a field in CDS from a dropdown and then patch that selected field.

I have a dropdown with say Items: ['field_a', 'field_b', 'field_c'] (referencing an entity in CDS)

Now, I could use multiple nested if statements for the Patch function:

If (Dropdown1.Selected.Value = 'field_a')

   Patch(EntityName, Gallery1.Selected, {'field_a': photoVariable}), and so on 

But there has to be a better way, no!?

I have tried multiple things without any success, get errors for all of them:

Patch(EntityName, Gallery1.Selected, {Dropdown1.Selected.Value: photoVariable})

Patch(EntityName, Gallery1.Selected, {'Dropdown1.TextValue': photoVariable}) and so on

Another thought was to reference the fields in the dropdown in another way, but no success there either.

Do you have any ideas of how I can get rid of all the If statements?

Thanks.

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    154,447 Most Valuable Professional on at

    HI @POJA85 ,

    I have done a blog on storing and viewing images which although SharePoint specific refers to the method of storing a photo as Base64 text in a multi-line text field. I am not sure on CDS, but you might try this method.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • WarrenBelz Profile Picture
    154,447 Most Valuable Professional on at

    Hi @POJA85 ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 542 Most Valuable Professional

#2
Haque Profile Picture

Haque 206

#3
Kalathiya Profile Picture

Kalathiya 201 Super User 2026 Season 1

Last 30 days Overall leaderboard