First
The First()
function returns the first item in a list or concept set.
This function is NOT SQL compatible. For more information about SQL compatibility, see our documentation.
Returns the first item in the given list
or concept_set
.
Returns Unknown
if one of the parameter values is unknown or outside the common valid date boundaries.
First() and Last() on a database list use the RowID for standard sorting - so
First([Name] of [Products])
will get the name-fieldvalue of the first item created, and
Last([Name] of [Products])
will get the name-fieldvalue of the last item created.
You can limit/specify the resultlist using the WHERE options, and within that resultlist, the lowest or highest RowID will be returned.
In future we will add the [Order By] syntax to WEM Expressions, so you can specify the order yourself in the expression, and then the First and Last will use that sorting.
In some specific cases if you want the First/Last item based on another fieldvalue, like LastModified, you could use something like
First([list] WHERE [LastModified] = Max([LastModified] of [List]))
Syntax
Parameters
list
List of elements of the same type
a list of values or elements of the same type.
concept_set
A list of concepts
a list of concepts
Last updated
Was this helpful?