The first()
function will return the first item in a list.
first(list)
list.first()
Code language: JavaScript (javascript)
Example Formulas
["Luffy", "Sanji", "Zoro"].first()
/* Output: "Luffy" */
/* In a database with a Relation property called Tasks: */
prop("Tasks").first()
/* Sample Output: "Position Video Lights"
Code language: JavaScript (javascript)
first()
, along with other list functions like last and at, are useful for accessing specific pages in a Relation property. Once you do this, you can access the properties of those pages:
prop("Tasks").first().prop("Status")
/* Sample Output: "To Do" */
Code language: JavaScript (javascript)