Skip to main content

SortBy

This formula allows you to sort an array (list) of values.

Returns

array<T>

JSON Format

{
"type": "sortBy",
"components": ...,
"sort_by_selector": ...,
"order": ...,
"sort_by_value_key": ...
}

RPG Script

This component can be written in RPG Script as:

sortBy(...)

Fields

FieldTypeRequiredDescription
sort_by_value_keyStringOptional parameter that lets you provide a key to use in the sort_by_selector formula to access the array's current value in the iteration. e.g: if you are iterating classes, you might want to assign "$class" to the sort_by_value_key, to make your system easier to read. This is also helpful when dealing with nested SortBy formulas, as it will allow inner SortBy formulas to access the values of outer filter formulas.