Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Preserve Dropdown choice after Patch

(0) ShareShare
ReportReport
Posted on by 150

I've simplified this down to two controls and one SharePoint source.

 

There's a Dropdown that picks a record from a SharePoint list and displays Title.

There's a TextInput control that defaults to Dropdown.Selected.Status

The OnChange property of the TextInput control is 

         Patch('SharePoint List', Dropdown.Selected, {Status:Self.Text})

 

Here's the problem:

When I select some item from the Dropdown, and then modify the Status, the item is correctly updated BUT THE DROPDOWN SELECTION RETURNS TO THE DEFAULT FIRST RECORD.  This is because the list is updated, the dropdown is dependent on the list, so the dropdown resets.

 

Is there any way to prevent this?  I want to be able to update (PATCH) the selected record without the Dropdown moving away from that selection.

Categories:
  • BostonSailor Profile Picture
    BostonSailor 150 on at
    Re: Preserve Dropdown choice after Patch

    Thank you, Rusk. That appears to work fine. 

  • Verified answer
    Rusk Profile Picture
    Rusk 1,369 on at
    Re: Preserve Dropdown choice after Patch

    You can add a variable to the OnChange, then set the "Default" for your Dropdown to that same variable. Something like:

     

    OnChange: 

    Patch('SharePoint List', Dropdown.Selected,Status:Self.Text});
    Set(varDropdown,Self.SelectedText.Value)

     

    Default:

    varDropdown

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,636

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,942

Leaderboard