Mastering Coda's Formulas
Share
Explore

icon picker
Filter

If you are going to spend learning and extensively using one formula in Coda the filter() formula is the one you want to know. It helps you get actionable insight on your data, summarize information in lookup columns, and oh so much more.

But be careful! With great power comes great responsibility. As your docs grow, filter() formulas can be big drainers on document performance. Learn more how to use it below!

First - let’s just learn how it works.

The filter() formula is like saying:
Hey Coda, can you go look into this table and give me all the rows that match a specific criteria?
In the following examples, we are going to take a look at the table and find specific information from it

All people over 79 years old
allPeople.filter(age>79)
@Andrea White
@Valerie Frank
@Matthew Mccoy
@Crystal Lamb
@Jeremy Stafford
@Ryan Yates
@Victoria Lopez
@Loretta Curtis
@Mark Watson
@Kelli Mcintosh
@Shawn Torres
@John Wilson
@Kathy Allen
All people with a salary < 20,000
allPeople.filter(annual salary > 20000)
@Daniel Ruiz
@Michele Matthews
@Michael Cline
@John Sullivan
@Renee Lamb
@Kelly Ayala
@Jerome Walker
@Kristin Lewis
@Kimberly Boyd
@Daniel Wheeler
@Katherine Summers
@Laura Torres
@Stephanie Hernandez

All people who’s name starts with “N”
allPeople.filter(name.startsWith("N")
@Nicolas Jones
@Nathan Garcia
@Nancy Mendoza
@Natalie Yu
@Nicole Johnson
@Nicole Rice
@Natalie Bailey
@Natalie Edwards
@Nancy Andrade
@Nathan Heath
@Nancy Johnson
@Nicole Hines
@Nina Morgan
@Nicole Mason
@Nancy Aguilar

You can also use it to return rows that match multiple criteria

All people with a birthday in May and who are over 67
allPeople.Filter(Birthday.Month()=5 and Age>67)
@Jessica Hawkins
@Melissa Garcia
@Carl Harper
@Denise Martin
@Elizabeth Chandler
@Thomas Freeman
@Brandon Long
@Lauren Kennedy
@Steven Hill

Now - let’s learn how to use it to really unlock some Coda magic

The filter() formula is really shines when used to summarize or lookup information from another table. For example, take these two tables below and their tasks - all the task information you see in the yellow columns is thanks to our filter() formula!
Projects
3
Name
Task Lookup
All Tasks
Complete Tasks
Incomplete Tasks
1
Clean Kitchen
Clean Kitchen
Clean Kitchen
Clean Kitchen
Clean Kitchen
4
2
2
2
Make Lunch
Make Lunch
Make Lunch
Make Lunch
Make Lunch
4
1
3
There are no rows in this table
Tasks
1
Project
Task
Complete
1
Clean Kitchen
Clean floors
2
Clean Kitchen
Wash Dishes
3
Make Lunch
Buy food
4
Clean Kitchen
Put away food
5
Make Lunch
Cook pasta
6
Make Lunch
Drain Pasta
7
Make Lunch
Eat!
8
Clean Kitchen
Wipe counters
There are no rows in this table

These are really powerful because then you can see all of you project information in one place! The filter() formula is how you begin to connect your tables and relate your information
Full Project Information
3
Search
Clean Kitchen
Clean Kitchen, Clean Kitchen, Clean Kitchen, Clean Kitchen
Make Lunch
Make Lunch, Make Lunch, Make Lunch, Make Lunch
Clean Kitchen
All Tasks
4
Complete Tasks
2
Incomplete Tasks
2
Task Lookup
1
2
3
4
Task
Complete
Clean floors
Wash Dishes
Put away food
Wipe counters
There are no rows in this table

Last - let’s learn how to optimize it

No need to reinvent the wheel here! Coda has written a wonderful blog on it and you can find that at the link below

Share
 
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.