JavaScript required
We’re sorry, but Coda doesn’t work properly without JavaScript enabled.
Skip to content
Demo: Contains() vs =
Dashboard
Back End
More
Share
Explore
Demo: Any() & All()
Aggregating boolean results across a filtered subset
Any() vs All()
When evaluating linked records, you often need to check a condition across an entire subset.
Use
Any()
when you want to know if
at least one
item meets the condition.
Use
All()
when you want to ensure
every single
item meets the condition.
// Any() aggregates the boolean results across the filtered set
DB Tasks
.
Filter
(
Project
.
Contains
(
thisRow
)
)
.
ForEach
(
[
Due
Date
]
<
Today
(
)
AND
Status
!=
"Completed"
)
.
Any
(
)
// Are all tasks on this project completed?
DB Tasks
.
Filter
(
Project
.
Contains
(
thisRow
)
)
.
ForEach
(
Status
=
"Completed"
)
.
All
(
)
See it in action below on the DB Projects table:
DB Projects Example
DB Projects Example
Name
Owners
Archived
Has Overdue Tasks?
All Tasks Completed?
Name
Owners
Archived
Has Overdue Tasks?
All Tasks Completed?
Website Redesign
Alice
Bob
Q4 Marketing Campaign
Alice
Internal Audit
Bob
Legacy Cleanup
Charlie
There are no rows in this table
Want to print your doc?
This is not the way.
Try clicking the ··· in the right corner or using a keyboard shortcut (
Ctrl
P
) instead.