Button to filter table

I’m not getting something here. I want a button that filters a table that shows only when a field is blank.

I’ve tried to figure it out myself, and worked through this page Filter tables via controls | Coda Help Center, and used MS Co-Pilot for suggested code, and reviewed other posts here (the ones I find on the topic are 3-5 years old). Nothing is working the way I want and I’m confused as to why this is so hard given that I find Coda to be very easy to use as a non-coder. I would have thought this would have been a pretty common request.

I understand I can use the filter bar but I have lots of fields on it and I want something that takes one click.

Here’s a simplified copy of what I’m trying to achieve.

I would love help solving the actual problem, but I’m also interested in thoughts on why this is hard. Why isn’t one of the options for a button “on click: create filter”?

Thanks for any insight.

Hello, I suggest you use a toggle control.

Then add a filter to the table based off the toggle’s value.

If you want to use a button, you can set the button’s action to set the toggle’s value.

Let me know if this helps!

2 Likes

I think it’s “hard” because a button only have one function, so if you apply a filter there’s no way to remove it unless you create the opposing button.

Instead you have to use canvas control, and you can alternatively make a button to change it’s value.

If you want to apply several filters, you can use a slider with the specific amount of numbers, and then a button to change the value.

So the table filter connects to the slider, and the button also connects to the slider.

2 Likes

Thank you very much. I got that to work. Don’t think I would have been able to figure that out myself!

2 Likes

Thanks Henrique. The automated version (Filter > create canvas control I believe) is a slider but I don’t find that useful for my situation. I get what you’re saying but I think this could be a lot easier than it is.

2 Likes

Works for sliders too, I have a table with 8 different filters being applied by a slider, and 8 buttons to change the values of the slider.

I’ve hidden the slider in another page since I don’t need to see it.

Do you mean (for example) you have buttons like 0-25%, 26-50%, 51-75%, 76-100% that are set to particular amounts on a slider?

To help others finding this later.

Note that my table has Income and Expenses as two separate fields.

I created this section below my table.

  1. Income toggle
  2. Expenses toggle
  3. Button to reset income toggle
  4. Button to reset expenses toggle

Then above my table I have three buttons.

image

  • Pressing the Income only button creates a filter where the field Expenses is blank and it shows only my income records.
  • Pressing the Expenses only button creates a filter where the field Income is blank and it shows only my expenses records.
  • Pressing the Reset button pushes two buttons 3. Button to reset income toggle and 4. Button to reset expenses toggle. This removes one or both filters from the table.

Thanks for the assistance.

3 Likes

I set the slider to 8 numbers only, each button changes the value to a certain number.

1 Like

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