Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

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.

  • disappointed Profile Picture
    90 on at
    Re: patch from dropdown if

    Thank you for your reply. 

  • Verified answer
    Giraldoj Profile Picture
    561 Super User 2025 Season 1 on at
    Re: patch from dropdown if

    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 

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard