cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

reset dropdown when row has been removed

Hi,

 

I have a dropdown that I want to be able to automatically removed once a row is removed from the table. There's a button I click on to remove the row but once its removed, The removed row still shows as a default with a X next to it in the dropdown box. I want it to disappear totally and default to the next available row.

 

I'm using the update context variable but I'm not sure if that's the best way to go.

6 REPLIES 6
Super User
Super User

Re: reset dropdown when row has been removed

Hi oria5467, 

 

Just want to make sure I understand your question right: You have a dropdown of say 5 values. There's a button that when clicked that removes one of the items in the dropdown (say 1st as an example). But once its removed, the removed row still shows as a default with a X next to it in the dropdown box. A few questions:

 

1. How are you populating the dropdown? Is it an option set or a collection or simply a set of text values? 

2. Can you provide the expression that you are using to remove the item from the dropdown? 

 

In the meantime, I am going to try this and let you know how I make it work. 

Anonymous
Not applicable

Re: reset dropdown when row has been removed

1. How are you populating the dropdown? Is it an option set or a collection or simply a set of text values? 

On change: Set(selectedvalue,First(Filter('[dbo].[BPATLoadStaging]',SourceName=Dropdown7.Selected.Result))); Dropdown 7 is the primary key drop down and source name is another dropdown that depends on dropdown 7 to populate.

Items: '[dbo].[BPATLoadStaging]'

Defaultseleteditems: selectedvalue

2. Can you provide the expression that you are using to remove the item from the dropdown? 

I pretty much set the reset property on the dropdown  7 to "resetprojectcodevar" and added *update({resetprojectcodevar: true})* to the *delete row button* on select property.

The dropdown is pretty much filtering a form.

Super User
Super User

Re: reset dropdown when row has been removed

I had prepared this example, so sharing it although not sure if its the same as yours (I will review yours after this one and add another example): 

 

I have a dropdown that is populated with a collection (which is being defined by a button): ClearCollect(DropdownCollection, "Value 1", "Value 2", "Value 3")

 

I then have a dropdown with this collection as the data source

 

I have another button that removes the 1st time. When I hit that button, the item gets removed and the dropdown defaults to the 2nd value. I have recorded a video as well: Here is the link: https://drive.google.com/file/d/1hHa7F82RIqMjMuvTDh8d3ZAlg_H480Wf/view?usp=sharing 

Super User
Super User

Re: reset dropdown when row has been removed

Are you using a dropdown or a combobox? 

Anonymous
Not applicable

Re: reset dropdown when row has been removed

combobox. 

Super User
Super User

Re: reset dropdown when row has been removed

Just making sure I got it right:

 

1. So you have a combo box that is populated with Items property as Items: '[dbo].[BPATLoadStaging]'

2. For that same combo box, the DefaultSelectedItems property is Defaultseleteditems: selectedvalue

3. The reset property of the combo box is resetprojectcodevar

4. The button to remove a value has its OnSelect as update({resetprojectcodevar: true})

 

So 2 questions: 

1. How are you "removing" a value or do you just want to reset the combo box to select a default value? 

2. Is there a specific reason why you are using a combo box vs a dropdown? 

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (10,220)