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
Super User
Super User

@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
Super User
Super User

@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

@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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (37,849)