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.
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! 🍻
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.
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:
""
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! 🍻
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?
Hi @Gado
I tried is also with a dropdown and a listbox:
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! 🍻
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.
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.
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! 🍻