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.

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

First(list)

First(List("A", "B", "C")) =>Result: "A"

First([Products] where [Product.Price] > 10) =>Result: returns the first row of products that cost more than 10 euro

First([Products] WHERE [LastModified] = Max([LastModified] of [Products])) =>Result: returns the last modified item in products (first row of products that has been modified last)

First() =>Result: unknown

First(concept_set)

First({ Color.Orange, Color.Blue, Color.Red }) =>Result: Color.Orange

First() =>Result: unknown

Parameters

Name
Type
Required
Description

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?