Inside this article
We've already covered what Controls are and how to filter your table. But what if you want to combine the convenience of controls with the power of filtering your table? In this article, we'll cover a few ways to do just that.
Canvas controls are a great option if you want everyone to see the same data. If you have a large table/database table where many teams or team members need to work with different data at the same time, the filter bar is the best option for working collaboratively so members' workflows are not disrupted. For more information about the filter bar, please check this article out!
Using the canvas control from the column menu
Canvas controls refer to Coda's ability to select an appropriate filter depending on the column type, and to put it anywhere on the canvas, separate from your table.
To use canvas controls:
right click on any column
scroll to "Filter" and then select “Canvas control”
then select “create control”
You just created a control that can filter your data! Coda has already set up the filter and connected it to the control for you. No further setup is needed. Here's an example of the above flow in action:
Curious about the logic of the filter? Check out the filter in the same way you would a normal table filter! Click on the "Filter" button above the table and then click on the kebab (the "..." but vertical) and then click "show formula". The gif below shows how to do this.
The control that gets created depends on the type of column. So in the above example, where we create a canvas control based on a text column, Coda generated a text input control. What about currency columns? Or select list columns? Watch how in the gif below Coda generates a slider control for currency columns and a select list control for a select list column type (and allows you to use both concurrently!):
Try it out on other columns to see what other controls get populated!
But what if you want to set up your own control with your own logic for filtering? Read on!
Setting up your own control with your own filter logic
Interactive filters are nice because they do all the heavy lifting when it comes to creating the control and writing the logic. But sometimes you'll disagree with the resulting setup and wish it worked differently. Now, we'll show you how to set up your own filters with the controls and logic you want!
Before we begin, it helps to have:
a table with values (otherwise, what are you going to filter?)
an idea of how you want to filter the table
an understanding of the basics of Coda's formula language and a tab open with the different formulas to guide how your thinking about what's possible
an idea of what controls exist (feel free to type /control and select the different options to get a sense of what's out there!)
Broadly speaking, setting up a control to filter a table or view is a two-step process:
Setting up the control
Hooking it up to your table filter
Let's start with setting up the control. Assuming you know what controls are and how to set them up, it's pretty fast: give it a name and designate what values are selectable for the control. If you need to refresh your knowledge of controls, check out steps 1 and 2 of this article. Feel free to also watch the gif below.
Sweet, you now have a control. Now how do we hook it up to your table filter?
Navigate to the table you want to be filtered by the control.
Hover over it, and then click the "Filter" button above it.
From here click "Add Filter" and then the kebab where you'll hit "show formula". You'll notice you can still click the "Add Filter" button below in case you want to add more filter criteria outside of this formula one.
Click into the new box that appears, turns out it's a formula editor window!
From here, you'll want to write a formula that references the control you're using. This is a good time to remember the name you gave to the control so you can reference it in the formula. The below gif shows the steps above:
In this example since I was comparing numbers, I wrote a simple formula to treat the number in the "Budget Max" control as the maximum value; the table should be filtered to only show rows where the "Budget" value is less than the number in the control.
Alternatively, you can click the cursive "f" at the top to open the formula editor. The cursive "f" option is better if you know you're going to write a longer and more complex filter formula.
Right-click (control-click on a Mac) to view the control settings. Choose between “Personal” and “Collaborative” mode to determine whether the data filters are just for you, or for everyone:
Personal: Each Maker has their own value. Changes they make affect only them.
Collaborative: All Makers share the same value. Changes affect everyone.
And that's it! Now you can easily filter your tables without having to navigate to the table filter every time.
This article used some simpler examples but if you're curious about what others have done, feel free to check out our community, the Gallery, and our Youtube Channel! Or reach out to support via the bubble in the bottom right of your screen to speak to a real human (after our bot asks some helpful questions :} ).
Note: When you use a control to filter data, the filtered view of your data will be visible to all doc collaborators. If you’d like an easy way to clear your filters or set a default value, you can configure buttons or automations with the “Set control value” function..