cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

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
lakishar
Level: Powered On

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)

3 REPLIES 3
lakishar
Level: Powered On

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)

Re: Change Drop Down Items

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

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
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 207 members 4,360 guests
Please welcome our newest community members: