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)

View solution in original post

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)

View solution in original post

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
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 175 members 5,007 guests
Recent signins:
Please welcome our newest community members: