The at()
function will return the list item value at the specified index.
at(list, number)
list.at(number)
Code language: JavaScript (javascript)
Lists use zero-based indexing, so the first item in a list will have an index of 0
.
Example Formulas
at(["Batman", "Robin", "V", "Doctor Doom"], 0) /* Output: Batman */
[1, 2, 3, 4].at(3) /* Output: 4 */
Code language: JavaScript (javascript)
at()
, along with other list functions like last and first, are useful for accessing specific pages in a Relation property. Once you do this, you can access the properties of those pages:
/* In a database with a Relation property called Tasks: */
prop("Tasks").at(1).prop("Status")
/* Sample Output: "Doing" */
Code language: JavaScript (javascript)