cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver I
Resolver I

Cascade Dropdown with Add new value capability

Hi All,

 

I created cascade dropdown (3 dropdown) is working well, but in dropdown is it possible to configure, if the value not in lists, users can add new value within the new form (pop-up), than the new created value will auto selected in the list.

 

Thanks for any advice

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Responsive Resident
Responsive Resident

Re: Cascade Dropdown with Add new value capability

Let's assume you have 3 cascading dropdowns:

  dropCountry, dropState, dropCity

Let's assume you have a list (e.g. SharePoint) of city, state, countries:

ID  | City                 | State          | Country
1 | Miami | Florida | USA
2 | Houston | Texas | USA 3 | New York City | New York | USA
4 | Albany | New York | USA

dropCountry.Items =

Sort(Distinct(myList, Country), Ascending)

dropState.Items = 

Sort(  
  Distinct( 
    Filter(myList, Country=dropCountry.Selected.Result).
    State
  ),
  Ascending
)

dropCity.Items =

ShowColumns(
  Filter(myList, State=dropState.Selected.Result && 
  Country=dropCountry.Selected.Result),
"ID", "City"
)

When you create a popup, you can validate that the popup only appears when all dropBoxes have values. Once that condition is satisfied, a patch command could be applied like this:

Patch(myList, Defaults(myList)
  {
    City: textboxUserInput.Text,
    State: dropState.Selected.Result,
    Country: dropCountry.Selected.Result
  }
)

If you are using temporary collections, then you would need to execute a refresh of sorts. If you are working directly with the actual datasource, it is not necessary.

 

I know your project is probably different, but hopefully this gives you some ideas.

View solution in original post

3 REPLIES 3
Highlighted
Anonymous
Not applicable

Re: Cascade Dropdown with Add new value capability

Hi @daroot,

This should be possible. You would have to ensure though that the option that you're adding uses the same ID/Options before it in order to preserve the cascade.

 

You could Patch or SubmitForm(), depending on how your app is set up and store the ID or Title of the new item in a variable which you can then input into the dropdown you're choosing from. On the dropdown you're adding the new value to, you could set up some rules to use the specific ID depending on what the user chooses.

 

 

Highlighted
Responsive Resident
Responsive Resident

Re: Cascade Dropdown with Add new value capability

Let's assume you have 3 cascading dropdowns:

  dropCountry, dropState, dropCity

Let's assume you have a list (e.g. SharePoint) of city, state, countries:

ID  | City                 | State          | Country
1 | Miami | Florida | USA
2 | Houston | Texas | USA 3 | New York City | New York | USA
4 | Albany | New York | USA

dropCountry.Items =

Sort(Distinct(myList, Country), Ascending)

dropState.Items = 

Sort(  
  Distinct( 
    Filter(myList, Country=dropCountry.Selected.Result).
    State
  ),
  Ascending
)

dropCity.Items =

ShowColumns(
  Filter(myList, State=dropState.Selected.Result && 
  Country=dropCountry.Selected.Result),
"ID", "City"
)

When you create a popup, you can validate that the popup only appears when all dropBoxes have values. Once that condition is satisfied, a patch command could be applied like this:

Patch(myList, Defaults(myList)
  {
    City: textboxUserInput.Text,
    State: dropState.Selected.Result,
    Country: dropCountry.Selected.Result
  }
)

If you are using temporary collections, then you would need to execute a refresh of sorts. If you are working directly with the actual datasource, it is not necessary.

 

I know your project is probably different, but hopefully this gives you some ideas.

View solution in original post

Highlighted
Resolver I
Resolver I

Re: Cascade Dropdown with Add new value capability

Thanks for solutions, really appreciate 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,333)