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 / Reset ListBox on form
Power Apps
Answered

Reset ListBox on form

(0) ShareShare
ReportReport
Posted on by 15

Hello,

 

I am still a novice on PowerApps and I am stuck on a dropdown list that does not reset when I want to switch the form to add mode...

 

I have a button that allows me to switch to another screen in add mode with the following formula:

Set(varEditMode;"AddNew");; Navigate(Client_Details;ScreenTransition.Cover;{})

 

When I want to view the data, I have the following formula on the OnSelect of my Gallery:

Set(varEditMode; "ReadOnly");; Navigate(Client_Details;ScreenTransition.Cover)

 

My form's data source is: 

LookUp(tabClients;cl_ID=Clients_Gallery.Selected.cl_ID)

 

My dropdown list has the source: tabEntites

The displayed value: en_Libelle

The Default property is set to:

LookUp(tabEntites;en_ID=ThisItem.cl_ID_Entite;en_Libelle)

 

When I switch to add mode, ThisItem.cl_ID_Entite is indeed empty, but the text displayed in my dropdown list remains stuck on the last displayed value.

 

Do you have any ideas to solve my issue, please?

 

Thank you in advance.

Categories:
I have the same question (0)
  • SpongYe Profile Picture
    5,715 Super User 2025 Season 2 on at

    @Gado 

     

    Yeah you have to do it another way in Powerapps. Good luck further. 

    It would be also good to others to see that your problem got solved by accepting a answer for this topic. 

     

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

  • Gado Profile Picture
    15 on at

    Hello,

     

    Okay!

    So, in PowerApps, we can't do something like in VBA where we say ListIndex = -1?

     

    By adding an empty row in my tabEntites, it actually solves the issue for me. The database is on Excel.

     

    It's a bit special:)

     

    Thank you for your help once again.

  • Verified answer
    SpongYe Profile Picture
    5,715 Super User 2025 Season 2 on at

    Hi @Gado,

     

    You want a blank value as the defualt value also after resetting.

    You need to have the blank value in you datasource or collection:

     

    ClearCollect(
     colDropDownSample, 
     {Value:""}, 
     DropDownSample
    );

     

    Than the Dropdown Default propety need to be:

     

    ""

     

    SpongYe_0-1701434923443.png

     

    And then after every reset you will get no pre-selection in the dropdown list.

     

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

     

  • Gado Profile Picture
    15 on at

    Hello,

    In your demonstration, the values in the lists default to 1.

    What I'm trying to achieve is to have no pre-selection in the dropdown list.

    Is that possible?

  • SpongYe Profile Picture
    5,715 Super User 2025 Season 2 on at

    Hi @Gado 

     

    I tried is also with a dropdown and a listbox:

    SpongYe_0-1701432200559.gif

    Both working. 

     

    Can you elaborate more on where you reset the code?

     

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

  • Gado Profile Picture
    15 on at

    Hello SponYe,

     

    Thank you for your help, but it hasn't changed anything.

    I still have a display issue.

     

    Furthermore, if I create a new record without changing the value of the dropdown list, it retains the displayed value as data.

  • SpongYe Profile Picture
    5,715 Super User 2025 Season 2 on at

    Hi @Gado 

     

    You do this by setting the Reset property of any control to a context variable, say ResetVar.

     

    Then you put this code into whatever event you want to trigger the reset (e.g. a button OnSelect or a OnVisible or OnHidden etc.)

     

     

    UpdateContext({ResetVar: true}); UpdateContext({ResetVar: false})

     

     

    Then all of the controls with ResetVar as Reset property will be simultanaously reset to the Default value.

    SpongYe_1-1701429375441.png

    SpongYe_2-1701429382809.png

     

     

     

     

     

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

     

     

     

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
Kalathiya Profile Picture

Kalathiya 421

#2
WarrenBelz Profile Picture

WarrenBelz 365 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 339 Super User 2025 Season 2

Last 30 days Overall leaderboard