cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Patron
Post Patron

Change Drop Down Items

Hello! I'm trying to change the Items property of a drop-down upon selected. Here's the steps.

 

1. User goes to screen.

2. User clicks on a button (BtnChangeSource1 OR BtnChangeSource2 )

3. The items property of the dropdown changes (DDSource)

 

 

I've created 2 Collections from the OnStart Property (IceCream and Cheese).  I want my users to have to ability to change the data source of a drop down menu item when they click on either button. 

 

How would one accomplish this?

 

Brendon

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Frequent Visitor

Re: Change Drop Down Items

One way to change the source of a dropdown based on button clicks is to set a variable onSelect

 

BtnChangeSource1 onSelect Set(Source,IceCream)

BtnChangeSource2 onSelect Set(Source,Cheese)

 

Then in your dropdown field 

Items Switch(Source,IceCream,IceCream,Cheese,Cheese)

View solution in original post

3 REPLIES 3
Highlighted
Frequent Visitor

Re: Change Drop Down Items

One way to change the source of a dropdown based on button clicks is to set a variable onSelect

 

BtnChangeSource1 onSelect Set(Source,IceCream)

BtnChangeSource2 onSelect Set(Source,Cheese)

 

Then in your dropdown field 

Items Switch(Source,IceCream,IceCream,Cheese,Cheese)

View solution in original post

Highlighted
Post Patron
Post Patron

Re: Change Drop Down Items

That worked! I forgot that PowerApps supported variables. Thanks again!

Highlighted
Post Patron
Post Patron

Re: Change Drop Down Items

I've revisited this problem...and I found something odd. 

 

When I create the variable for one button : 

  btnAllItems OnSelect  Set(CachedItems, AllItems)

I receive an error that states:

Incompatible type. We can't evaluate your formula because the context variable types are incompatible with the types of values in other places in your app.

Name isn't valid. This identifier isn't recognized. This error appears most commonly when a formula reefers to something that no longer exists(For example, a control you have deleted)

 

Another weird thing I've noticed. Both of these collections for btn1 and btn2 have to have similar columns. Or at least that's what I've run into. Any ideas why? Thanks

Brendon

 

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response 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 (3,412)