This function takes the name of an array and renames all fields of this array.

ParameterTypeRequiredDefault ValueDescription
array[a]stringrequired   Name of the array to rename. Must follow valid Array Syntax for array of scalars. For example, for events with fields incidents[0], incidents[1], ... this would be incidents[].
asArraystringrequired   The new name of the array. Must follow valid Array Syntax for array of scalars.

[a] The parameter name array can be omitted.

Hide omitted argument names for this function

Show omitted argument names for this function

array:rename() requires that the input array has continuous, sequential indexes with no gaps (empty indexes) and that the array starts at index [0], for example, incidents[0], incidents[1], incidents[2]. If there are gaps, for example, incidents[0], incidents[1], incidents[2], incidents[10] only the fields from index 0 up to the first empty index will be renamed.

If no array with the given name exists or the old and the new name are the same, the function does nothing.

Without this function, each element of an array would need to be renamed individually with the rename() function, or array:filter() should be used as a workaround as shown below:

logscale
array:filter(array="a[]", function={true}, var="", asArray="b[]")
| array:filter(array="a[]", function={false}, var="")

With the function, specify the name of the array to rename:

logscale
array:rename("a[]", asArray="b[]")

Click + next to an example below to get the full details.

Rename Existing Fields in Array

Rename existing fields in an array using the array:rename() function