web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

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
    152,967 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
    152,967 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 840 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 332 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 275

Last 30 days Overall leaderboard