The last()
function will return the last item in a list.
last(list)
list.last()
Code language: JavaScript (javascript)
Example Formulas
["Luffy", "Sanji", "Zoro"].last()
/* Output: "Zoro" */
/* In a database with a Relation property called Tasks: */
prop("Tasks").last()
/* Sample Output: "Set Up Compressor"
Code language: JavaScript (javascript)
last()
, along with other list functions like first 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").last().prop("Status")
/* Sample Output: "Done" */
Code language: JavaScript (javascript)