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 / patch from dropdown if
Power Apps
Unanswered

patch from dropdown if

(1) ShareShare
ReportReport
Posted on by 90

Several dropdowns (not on a form nor gallery).

The user is to select from a list from most important to least important.

The second dropdown contains all the items in the first list except the one selected. 

The third dropdown contains all the items in the first list except the ones selected in dropdowns one and two, etc.

Each dropdown is not visible until the one before it is selected.

The user may rank the list as far down as they want. For example, they can select from dropdowns one, two and three and then save to a Sharepoint list.

The issue is with the Patch. It is saving all the fields but if the user stops on item 3, item 4 saves the value default value "Select ..." which pops up after item four is selected but fields 5 to the end of the save same other values in the list not selected and not the default.

For some reason, the dropdowns after item 4 are showing each successive value as the next item on the list not shown in one of the preceding dropdowns.

At this point I don't even have a way to check the control and put a correct value in a variable for the patch.

Any insight would be appreciated.

Categories:
I have the same question (0)
  • Verified answer
    Giraldoj Profile Picture
    762 Super User 2025 Season 2 on at

    HI @disappointed 

     

    When patching the selected values from multiple dropdowns, make sure you only include the values that the user has selected and avoid patching default or unselected values. Here’s how you can achieve that

     

    1. Ensure you store the selected values of each dropdown in a variable when the user makes a selectio, for example:

     

    Set(varDropdown1, Dropdown1.Selected.Value);
    Set(varDropdown2, Dropdown2.Selected.Value);
    Set(varDropdown3, Dropdown3.Selected.Value);
    Set(varDropdown4, Dropdown4.Selected.Value);
    Patch ​

     

     

    2. Construct the patch function to include only the selected values by checking if the variables are not blank before including them in the patch:

     

    Patch(
     'SharePointListName',
     Defaults('SharePointListName'),
     {
     Column1: varDropdown1,
     Column2: If(!IsBlank(varDropdown2), varDropdown2, Blank()),
     Column3: If(!IsBlank(varDropdown3), varDropdown3, Blank()),
     Column4: If(!IsBlank(varDropdown4), varDropdown4, Blank())
     // Add additional fields as necessary
     }
    );​

     

     

    If my response resolved your issue, please feel free to mark it as the solution by clicking accept it as a solution

    If you liked my solution, please give it a thumbs up
    This helps others find the answer more easily.

    Connect with me: LinkedIn 

  • disappointed Profile Picture
    90 on at

    Thank you for your reply. 

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard