cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kaso78
Frequent Visitor

Having problems with filtering combo box (Choices)

I have been reading and watching various videos for about 2 days now and I am still not getting anywhere. I am trying to build a custom form using powerapps to add some dynamic showing and hiding of fields to allow users to enter in only the values that I need them to.

 

Here are the lists I have in scope and which ones have lookups to each other

ListsLookup to ScheduleLookup to Time cardLookup to Department listLookup to Station list
Schedule  
  • Title field(Department)
  • Cost code
 
Timecard
  • ID
  • Department_Flow(populated in Schedule via Flow)
  
  • Title (Station)
Department list    
Station list  
  • Title(Department)
  • Cost code
 

 

I am trying to get the end user to create a time card entry where depending on the entry may need to choose the Job they were working on. If they do that, they need to select the station they were working on.  However, equipment( or stations) can be in multiple departments. Example a brush could be part of the painting department and the maintenance department but the equipment isn't shared between the 2 departments.  We would have multiple "brushes" that each belong to their own department but they are the same model of equipment. 

 

Where i am having the problem is trying to filter the Station field(Lookup to the title field in 'Station List') while filtering on the 'Department' field(which is a lookup to the department list.)

 

I will have the user select the JobID from the dropdown (which is in the Schedule list and has the Department value and cost code).  I then want them to select the Station from the filtered combobox.  

 

I have a few screenshots for reference. The forms are just me figuring it out. example You will see 2 "Plate" in the department section and 2 spots for cost code. 

 

Any help would be appreciated.

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Eelman
Community Champion
Community Champion

@kaso78 

Have you tried something like this:

Filter(Station, Department.Value = DepartmentDataCardValue.Value).Title

Note: replace 'DepartmentDataCardValue' with your DataCardValue## that corresponds to the Department DataCard.

 

If this doesn't work, can you please list some code you have tried.

 

View solution in original post

kaso78
Frequent Visitor

Tried hard coding a value in the department list and it works. 

 

Filter('Station list', Department.Value = "Plate").Title

 

I guess it took me going outside to reboot to make sense of this. With your help, here is what I ended up using which now works dynamically. Looks like it wanted a text value from the dropdown (ddDept) I populated.

 

Filter('Station list', Department.Value = ddDept.SelectedText.Title).Title

View solution in original post

4 REPLIES 4
Eelman
Community Champion
Community Champion

@kaso78 

Have you tried something like this:

Filter(Station, Department.Value = DepartmentDataCardValue.Value).Title

Note: replace 'DepartmentDataCardValue' with your DataCardValue## that corresponds to the Department DataCard.

 

If this doesn't work, can you please list some code you have tried.

 

kaso78
Frequent Visitor

Tried hard coding a value in the department list and it works. 

 

Filter('Station list', Department.Value = "Plate").Title

 

I guess it took me going outside to reboot to make sense of this. With your help, here is what I ended up using which now works dynamically. Looks like it wanted a text value from the dropdown (ddDept) I populated.

 

Filter('Station list', Department.Value = ddDept.SelectedText.Title).Title

Eelman
Community Champion
Community Champion

@kaso78 

Well done on sorting this mate. You can also mark your answer as a Solution, if you like, so there are 2 solutions? This can help future PowerAppsters if they have a similar problem.

 

As a small suggestion, if I may, I'd recommended you using 'Selected' rather than 'SelectedText', if the option to do so is available. I tended to use the latter in the early days but found the former seems to work better. I cannot recall the reason why, just that I do it that way now 🙂 

kaso78
Frequent Visitor

I will give that a try.  Thank you for your help.  I have another issue that I am going to start a new thread on.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Solution Authors
Users online (4,388)