sort array by field
This block is part of the array group and was last modified in core v10.4.28.
sort array by field v10.4.28 Sorts the elements of an array by a given key.
- Array required
arrayThe array to be sorted.
- sort by
valueSort by the given field. If left empty, it will sort the entire array.
- A-Z / 1-9 required
conditionIf true: sort the array in ascending order (A-Z or 1-9). • Hidden when other fields are filled
- Z-A / 9-1 required
conditionDisplay-only counterpart of
asc: this pin is not read. Sorting is descending wheneverascis false or left unwired. • Hidden when other fields are filled
- Array
arrayThe sorted array.
Stable-sorts a COPY of the array; the input is not mutated. With sort_by set it sorts object items by that dot-path field, otherwise by the elements themselves. Direction is decided ONLY by the asc pin: true sorts ascending, unfilled or false sorts DESCENDING (the desc pin is display-only). Numbers compare numerically, strings lexicographically ("10" before "2"), a number and a numeric string compare numerically, and null sorts as smallest.
A typical wiring for sort array by field: true feeds the asc pin; group by feeds the array pin; value feeds the sort_by pin; == feeds the desc pin; the array out pin feeds join.

Commonly used with
In production blueprints, this block is most often wired together with:
- true: feeds into this block. Gives the condition true hard-coded.
- group by: feeds into this block. Groups the elements of the given array by a specified field.
- join: this block feeds into it. Creates and returns a new string by concatenating all of the elements in this array, separated by void if none provided.
- splice: this block feeds into it. Removes an item from your given array.
- create: feeds into this block. Creates a new function that can be executed using the given name.
- value: feeds into this block. Simply returns the provided value.
Version history
Introduced in v10.4.28.
Back to
array Return to the main group to view all sub-groups Back to array Return to the group to view all blocks within this group
