cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper IV
Helper IV

Filter displayed choices in a combo-box based on a separate drop-down

Looking at others who've asked a similar question, my scenario seems to be a bit different. 

 

I have a combobox that I want to display vehicle accessories depending on what vehicle type is selected.

 

Here is the table with the accessory values per vehicle:

 

vehicle costs.PNG

 

And the form:

 

form.PNG

 

So if the user selects small hatch, ideally they wouldn't be able to select Towbar as an option in the combobox. Though this isn't critical. The main functionality I need is to pull the specific cost of each selected optional extra from that list, to be used in a Sum further down. So if they selected first aid kit and rubber mats, the cost will add on 250.

 

The Sum is just adding up the costs of everything the user has selected (based on vehicle and lease length). Currently I just have a list with 1 amount for each accessory being used for all vehicles, which isn't very accurate for budgeting (which is the purpose of the form). The estimate will either be too high or too low. 

3 REPLIES 3
Highlighted
Advocate II
Advocate II

Re: Filter displayed choices in a combo-box based on a separate drop-down

Hello @rsparks ,

If I understand you correctly, you want the user to be able to choose specific extras based on the type of car they select.
To do this:

  1. You will need some kind of table with cars and available packages
    1. See the OnSelect property of the Button in the Sample App for one such schema.
  2. Then you need a way to display the specific extras for the chosen vehicle
    1. See the Items property of the Gallery control
  3. You'll also need a way for users to select 0 or N (all) extra packages. I'd suggest checkboxes in a Gallery control for this.
    1. See the OnCheck and OnUncheck properties of the CheckBox control for some goodies here.
  4. Finally to tally the total, you'll need a label which sums the costs.
    1. See the TextBox Text property for this goodie.

Peek 2019-10-14 22-21.gif

See attached SampleApp and study the concepts lined out.

Hope this helps you learn PowerApps!

Highlighted
Helper IV
Helper IV

Re: Filter displayed choices in a combo-box based on a separate drop-down

Using that table layout you've provided, I've made a list in Sharepoint that has 3 columns. Vehicle Type, Option and Cost.

 

Rather than managing the table within powerapps, I'd rather do it in Sharepoint so that I can share access (and as such pass maintanence of the table to someone else). How would I go about using filters to recreate the same functionalities that your app has?

 

I need the choice combobox to filter the Option column based on the Vehicle Type selected in a dropdown further up in the app. I'm not quite sure how to do that for a choice function, but I imagine it would something along the lines of embedding the Filter within the Choice. 

 

Then for summing the costs of each Option I would have to repurpose this function:

 

Round(((Sum(Filter('Optional Extra Costs',OptionalExtraName in ComboBox2.SelectedItems.Value),OptionalExtraCost))/Dropdown10.Selected.Val), 0)

 

Any suggestions for getting the Choice combobox working based on a Sharepoint list rather than a table set up as a collection?

 

 

Highlighted
Helper IV
Helper IV

Re: Filter displayed choices in a combo-box based on a separate drop-down

Nevermind, copied over your collection, gallery and checkbox ideas. Works very well. 

 

2 more questions, first is how do I patch the "Goodies" data to my Extras column in a list?

 

The old function I had was {'Optional Extras Package': Left(Concat(colMyItems, Value & ", "), Len(Concat(colMyItems, Value & ", "))-2)}.

 

Should I simply replace colMyItems with colCarsOptions?

 

Second, how do I make the gallery/datacard resize themselves based on how many choices are visible? As below, it doesn't look great with all the empty space if you're looking at a small hatch.

 

1.PNG2.PNG

Helpful resources

Announcements
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

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 (5,606)