sort

Sorts a list of values in the natural order. The first argument is the list of values, the second is a boolean value indicating if the sort is ascending (true) or descending (false).

Category

List

Function syntax

sort(<parameters>)

Parameters

Parameter Type
List listString
List listBoolean
List listInteger
List listDecimal
List listDuration
List listDateTime
List listDateTimeOnly
Boolean Boolean

Signature and returned type

sort(<listInteger>,<boolean>)

Returns a list of integers.

sort(<listDecimal>,<boolean>)

Returns a list of decimals.

sort(<listString>,<boolean>)

Returns a list of strings.

sort(<listDateTimeOnly>,<boolean>)

Returns a list of datetimes without considering time zone.

sort(<listDateTime>,<boolean>)

Returns a list of datetimes.

sort(<listBoolean>,<boolean>)

Returns a list of booleans.

Example

sort(["A", "C", "B"], true)

Returns ["A","B","C"].

sort([1, 3, 2], false)

Returns [3, 2, 1].

On this page

Adobe Summit Banner

A virtual event April 27-28.

Expand your skills and get inspired.

Register for free
Adobe Summit Banner

A virtual event April 27-28.

Expand your skills and get inspired.

Register for free
Adobe Maker Awards Banner

Time to shine!

Apply now for the 2021 Adobe Experience Maker Awards.

Apply now
Adobe Maker Awards Banner

Time to shine!

Apply now for the 2021 Adobe Experience Maker Awards.

Apply now