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 / How to Preserve values...
Power Apps
Answered

How to Preserve values in the textinput inside the gallery when switching the choices in the combo box

(0) ShareShare
ReportReport
Posted on by 92

the goal is to allow users to enter values into text input fields within a gallery based on a selected choice in a combo box. However, when users switch between different choices using a combo box, the entered values in the text inputs should be preserved and displayed if the user returns to a previously selected choices in the combo box.

Categories:
I have the same question (0)
  • Verified answer
    v-mengmli-msft Profile Picture
    on at

    Hi @LsLee ,

     

    You can use AddColumns to add multiple columns for each choice and patch inputs to corresponding choice columns.

    Assuming that Items of combo box is this.

    ["Choice1","Choice2"]

    Step1.

    OnStart of App or OnVisible of Screen.

    ClearCollect(COL,AddColumns(DataSource,Choice1,"",Choice2,""))
    

    Step2.

    OnChange of TextInput.

    Switch(ComboBox.Selected.Value,"Choice1",Patch(COL,ThisItem,{Choice1:Self.Text}),"Choice2",Patch(COL,ThisItem,{Choice2:Self.Text}))

    Default of TextInput.

    Switch(ComboBox.Selected.Value,"Choice1",ThisItem.Choice1,"Choice2",ThisItem.Choice2)

    Step3.

    It should have a column in your data source to save selected choice.

    OnChange of Combo box.

    Patch(COL,ThisItem,{Title:Self.Selected.Value})

    DefaultSelecteItems of Combo box. 

    {Value:ThisItem.Title}

     

     

    Best regards,

    Rimmon

  • LsLee Profile Picture
    92 on at

    Thank you for the guidance.

    Can the Powerapps also achieve this?

    the entered values persist in the gallery even when the ComboBox filter is cleared

  • v-mengmli-msft Profile Picture
    on at

    Hi @LsLee ,

     

    You can add a condition in Switch function to set default value when combo box is cleared.

    Something just like this.

    Switch(ComboBox.Selected.Value,"Choice1",ThisItem.Choice1,"Choice2",ThisItem.Choice2,"","the entered values you want to keep")

    The entered values for each choice is not lost, as the input value has already been saved to the corresponding column.

     

    Best regards,

    Rimmon

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

#2
Kalathiya Profile Picture

Kalathiya 321

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 311 Super User 2025 Season 2

Last 30 days Overall leaderboard