Search…
⌃K
Links

last

To return the last item of an array
You can access the last entry of an array with this function. This function comes in handy if you try to access a record in an array of records.
The record IDs of the tables are arranged differently in the multiple platforms. Therefore, different results are displayed according to each platform. This applies if the array consists of records.
If you combine the function with select and the respective array has more than 1 element, we recommend sorting the array first with order by.

Syntax

last([any])

Return

any

Examples

1
last(["B", "A", "C"])
Result: C
1
last(select Customer)
Result: Returns the last record of the table Customer.
1
last((select Customer where substr('Last name', 0, 1) = "A") order by 'Last name')
Result: Returns the last record of the table Customer where the last name starts with an A.

See also

first, which returns the first item of an array.
item, which extracts a value of an array or an object.
Last modified 1mo ago