sort
Last update: May 30, 2022
- Topics:
- Journeys
CREATED FOR:
- Experienced
- Developer
Sorts a list of values or objects in the natural order.
Category
List
Function syntax
sort(<parameters>)
Parameters
Parameter | Type | Description |
---|---|---|
listToSort | listString, listBoolean, listInteger, listDecimal, listDuration, listDateTime, listDateTimeOnly, listDateOnly, or listObject | List to sort out. For listObject, it must be a field reference. |
keyAttributeName | string | This parameter is only for listObject. The attribute name in the objects of the given list is used as key for sorting. |
sortingOrder | boolean | Ascending (true) or descending (false) |
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(<listDateOnly>,<boolean>)
Returns a list of dates.
sort(<listBoolean>,<boolean>)
Returns a list of booleans.
sort(<listObject>,<string>,<boolean>)
Returns a list of objects.
Example
sort(["A", "C", "B"], true)
Returns ["A","B","C"]
.
sort([1, 3, 2], false)
Returns [3, 2, 1]
.
Previous pageserializeList
Next pagerandom
Journey Orchestration
- Product documentation
- What’s new
- Starting with Journey Orchestration
- Configuring an event
- Configuring a data source
- Configuring an action
- Using segments
- Building a journey
- Build expressions
- Building your reports
- Integrating with Intelligent Services
- Use cases
- Working with APIs