The some()
function will return true if at least one of the items in a list match the condition (unlike every, which requires all elements to match it).
some(list, condition)
list.some(condition)
Code language: JavaScript (javascript)
Example Formulas
[1, 0, 3, -12, 5].some(
current > 0
)
/* Output: true */
Code language: JavaScript (javascript)
You can use some()
to run a check on a specific property within every page in a Relation property. For example, let’s say we want to check whether a project has any in-progress tasks:
prop("Tasks").some(
current.prop("Status") == "Doing"
)
/* Sample Output: true */
Code language: JavaScript (javascript)
Once you have this value in a formula property, you could even filter a database view by it in order to show only projects that have active, in-progress tasks.