Array
NOTE
When a filter below refers to the parent value, we're talking about the value box that lives immediately above the filter.
[
{
"name": "Chris"
},
{
"name": "Shawn"
}
]
append
Adds a new element to the end of the array, and return the updated array

parent value
The original array you'd like to modify
[1,2,3,4]
value
The value to add to the end of the array
5
parent value: [1, 2, 3, 4]
value: 5
[1, 2, 3, 4, 5]
parent value: ["Think Visually", "Build Confidently"]
value: "Deploy Securely"
["Think Visually, Build Confidently, "Deploy Securely"]
parent value:
[
{
"name": "Chris"
},
{
"name": "Shawn"
}
]
value:
{
"name": "Cameron"
}
[
{
"name": "Chris"
},
{
"name": "Shawn"
},
{
"name": "Cameron"
}
]
count
Returns the number of items in an array

parent value
The array to count
[1, 2, 3, 4, 5]
[
{"name": "Chris"},
{"name": "Shawn"}
]
[
{"name": "Chris"},
{"name": "Shawn"}
]
2
[1, 2, 3, 4, 5]
5
diff / diff_assoc
intsersect / intersect_assoc
These filters are used to compare arrays.
diff is used to show values from the first array that are not in the second array
intersect is used to show values from the first array that are in the second array
Use the basic filter for value arrays, and the _assoc version for arrays of objects.

parent value
The first array to compare
[1, 2, 3, 4, 5]
[
{"name": "Chris"},
{"name": "Shawn"}
]
value
The second array to compare
Same as above
Using diff:
parent value: [1,2,3,4,5]
value: [3,4,5,6,7]
[1, 2]
Using diff_assoc: parent value:
[
{"name": "Chris"},
{"name": "Shawn"},
{"name": "Cameron"}
]
value:
[
{"name": "Chris"},
{"name": "Shawn"}
]
[
{"name":"Cameron"}
]
Using intersect:
parent value: [1,2,3,4,5]
value: [3,4,5,6,7]
[3, 4, 5]
Using intersect_assoc: parent value:
[
{"name": "Chris"},
{"name": "Shawn"}
]
value:
[
{"name": "Chris"},
{"name": "Shawn"},
{"name": "Cameron"}
]
[
{"name": "Chris"},
{"name": "Shawn"}
]
filter_empty
Returns a new srray with only entries that are not empty.
An empty value can be []
, {}
, 0
, null
, ""
, or false
.

parent value
The array to filter
[1, 0, 2, 0, 3]
[
{"name":"Chris"},
{},
{"name":"Shawn"}
]
path
When filtering arrays of objects, you can specify a path to optionally use a specific key to judge emptiness.
[
{"name":"Chris"},
{},
{"name":"Shawn"}
]
[
{"name":"Chris"},
{"name":"Shawn"}
]
[1, 0, 2, 0, 3]
[1, 2, 3]
first
Get the first entry of an Array.

parent value
The array to retrieve the first entry from
[1, 2, 3]
[
{"name":"Chris"},
{"name":"Shawn"}
]
[1, 2, 3]
1
[
{"name":"Chris"},
{"name":"Shawn"}
]
{"name":"Chris"}
filter_empty_array
filter_empty_object
filter_empty_text
filter_false
filter_null
filter_zero
These filters are designed to remove the corresponding values from an object or an array. Useful in scenarios where something is sending data to your APIs that you don't have full control over, such as a frontend platform that always sends empty strings or null values.
parent value
The array or object to target
{
"title": "",
"name": false,
"width": 0,
"items": [],
"data": {},
"info": null
}
filter_empty_array
{
"title": "",
"name": false,
"width": 0,
"data": {},
"info": null
}
{
"title": "",
"name": false,
"width": 0,
"items": [],
"data": {},
"info": null
}
filter_empty_object
{
"title": "",
"name": false,
"width": 0,
"items": [],
"info": null
}
{
"title": "",
"name": false,
"width": 0,
"items": [],
"data": {},
"info": null
}
filter_empty_text
{
"name": false,
"width": 0,
"items": [],
"data": {},
"info": null
}
{
"title": "",
"name": false,
"width": 0,
"items": [],
"data": {},
"info": null
}
filter_false
{
"title": "",
"width": 0,
"items": [],
"data": {},
"info": null
}
{
"title": "",
"name": false,
"width": 0,
"items": [],
"data": {},
"info": null
}
filter_null
{
"title": "",
"name": false,
"width": 0,
"items": [],
"data": {}
}
{
"title": "",
"name": false,
"width": 0,
"items": [],
"data": {},
"info": null
}
filter_zero
{
"title": "",
"name": false,
"items": [],
"data": {},
"info": null
}
flatten
Flattens a multi-level array into a single-level array.
parent value
The array to flatten
[
[1, 2, 3],
[4, 5, 6],
[7, 8, 9]
]
[
[1, 2, 3],
[4, 5, 6],
[7, 8, 9]
]
[1, 2, 3, 4, 5, 6, 7, 8, 9]
[
{
id: 1,
name: "John",
pets: [
{ type: "dog", name: "Rex" },
{ type: "cat", name: "Whiskers" }
]
},
{
id: 2,
name: "Sarah",
pets: [
{ type: "bird", name: "Tweety" }
]
}
]]
[
{
ownerId: 1,
ownerName: "John",
petType: "dog",
petName: "Rex"
},
{
ownerId: 1,
ownerName: "John",
petType: "cat",
petName: "Whiskers"
},
{
ownerId: 2,
ownerName: "Sarah",
petType: "bird",
petName: "Tweety"
}
]
join
Converts an array into a text string by joining each value and using a separator.

parent value
The array to join
["a", "b", "c"]
separator optional
The character or characters to place in between each array item
Can be any text value, or even a single empty space
parent value: ["a", "b", "c"]
separator: _
a_b_c
parent value: [1, 2, 3, 4, 5] separator:
12345
last
Get the last entry of an Array.

parent value
The array to get the last entry of
[1, 2, 3]
[1, 2, 3]
3
merge
merge_recursive
Merge two arrays or objects together and return the new item.
Use merge to merge single level data.
Use merge_recursive to merge multi-level data.

parent value
The first array to merge
[1, 2, 3]
value
The second array to merge
[4, 5, 6]
using merge
parent value: ["a", "b", "c"]
value: ["d", "e", "f"]
["a", "b", "c", "d", "e", "f"]
using merge_recursive
parent value:
{
"a": "test",
"b": ["a","b"]
}
value:
{
"c": "hi",
"b": ["c","d"]
}
{
"a": "test",
"b": ["a","b","c","d"]
"c": "hi",
}
pop
Pops the last element of the Array off and returns it.
Please note that Xano's pop filter does NOT remove the item from the array.

prepend
Push an element on to the beginning of an array

push
Push an element on to the end of an array

range
Returns array of values between the specified start/stop.

remove
Remove any elements from the array that match the supplied value and return the new array

Use the path option to search inside of objects.
Use the strict option to determine how precise the filter is (for example, treating 100 and "100" the same)
safe_array
Always returns an array. Uses the existing value if it is an array or creates an array of one element.

shift
Shifts the first element off the Array and returns it.

shuffle
Returns the array in a randomized order

slice
Extracts and returns a section of an array
offset - what index should the slice start, starting at 0
length - how many items to slice

sort
Sort an Array of elements with an optional path inside the element, sort type, and ascending/descending. Sort types include:
text - case-sensitive sort for text
itext - case-insensitive sort for text
number - to sort numerically
natural - case-sensitive sort that is alphanumerical and natural to humans
inatural - case-insensitive sort that is alphanumerical and natural to humans
Ascending order is performed with a true boolean. Descending order uses a false boolean.
The example below shows the difference between case-sensitivity sort with text and itext:


The example below shows how to use the number sort type:

The example below shows using the natural sorting option

unique
Returns unique values of an Array. You can also use this filter with an array of objects by specifying a path to the key you would like to use to judge uniqueness.

unshift
Push an element to the beginning of an Array and return the new Array.

pick/unpick
These filters are meant to be used when dealing with Object field types and are particularly useful if you are receiving a large object, from a webhook for example, where only a few of those records are required for your workflows. You can also use them with an array of objects by specifying a path to the key you would like to make changes to.
Pick: Identify values you would like to keep and the filter will return a new object containing only the values you have selected.



Unpick: Identify values you would like to exclude and the filter will return a new object containing only the fields that weren’t omitted.



Last updated
Was this helpful?