Using a Button to Switch Filters on a List

I would like to ask you all for guidance on this scenario.

I have a list of tasks that I want to show on a screen. There are 2 categories of tasks “Work” and “Home”.

I would like to have 2 buttons where you can select “Work” or “Home” and it ideally highlights the one you have selected.

Then the task list below those buttons would be filtered to only show “Work” tasks or “Home” tasks dependent on which button has been pressed.

What would be the best approach for this? Would it need to be two separate screens and basically the buttons switch between the two (maybe hiding one or the other accordingly) or is there a more clever way to do it on the same screen?

Thanks in advance for your ideas!

Jonathan

Lots of different ways to approach this.

A really simple way is to just enable filtering on your task collection by task type. This won’t quite give you exactly what you want, but it incurs zero updates when users switch between task types.

To do it as you describe, you could either use buttons or a choice component. I’d use a choice component as the selected item will always be highlighted. Write the selected choice to a User Specific column, and then apply a filter to your Task collection: “Task Type is Screen → User Specific Column”

There are more advanced methods that can involve the use of further data editor logic, (Single Values, if-then-else, relations, etc) but most of those are overkill for a simple use case like this.

Hi Darren,

That’s very helpful, thanks. I wasn’t aware of being able to pick up on the “screen” choice - very useful. I have got it working using a choice and radio buttons.

Jonathan

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.