Array
Last updated
Was this helpful?
Last updated
Was this helpful?
- Push an element on to the end of an array within an object and return the updated object
- Return the number of items of an array
- Return values from the first array not present in the second. Only values are used for matching.
- Return values from the first array not present in the second. Keys and values are used for matching.
- Returns a new array with only entries that are not empty ("", null, 0, [])
- Returns the first item of an array
- Flattens a multi-dimensional array
- Return values from the first array that are present in the second. Only values are used for matching.
- Return values from the first array that are present in the second. Keys and values are used for matching.
- Joins an array into a text string via the separator and returns the result
- Returns the last item of an array
- Merges two arrays
- Merge all levels of both arrays
- Pops the last element of an array off and returns it
- Prepend an element on to the beginning of an array
- Push an element on to the end of an array
- Returns array of values between the specified start/stop
- Remove any elements from the array that match the supplied value and return the new array
- Always return an array from the specified value
- Shifts the first element off the Array and returns it
- Returns the array in a randomized order
- Extracts a specific section of an array
- Sorts an array
- Returns the array with duplicate values removed
- Push an element to the beginning of an Array and return the new array
- Pick keys from the object to create a new object of just those keys.
- Remove keys from the object to create a new object of the remaining keys.
Push an element on to the end of an Array within an object and return the updated object.
Return the number of items of an Array.
These filters will return values in the first array that are not present in the second array.
diff will only use values for matching
diff_assoc will use keys and values for matching
Returns a new Array with only entries that are not empty ("", null, 0, []). Use the path option if you want to search inside of objects.
Get the first entry of an Array.
These filters are designed to remove the corresponding values from an object or an array. Useful in scenarios where something is calling your APIs that you don't have full control over, such as a frontend platform.
parent value
The array or object to target
filter_empty_array
filter_empty_object
filter_empty_text
filter_false
filter_null
filter_zero
Flattens a multi-level array into a single-level array.
Returns the entries from the first array that are present in the second array.
intersect will use values for matching
intersect_assoc will use keys and values for matching
Joins an array into a text string via the separator and returns the result
Get the last entry of an Array.
Merge the first level of elements of both Arrays together and return the new array.
Merge the elements from all levels of both Arrays together and return the new Array.
First array:
Second array:
We will then set up our filter as follows:
Pops the last element of the Array off and returns it.
Please note that Xano's pop filter does NOT remote the item from the array.
Push an element on to the beginning of an array
Push an element on to the end of an array
Returns array of values between the specified start/stop.
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)
Always returns an array. Uses the existing value if it is an array or creates an array of one element.
Shifts the first element off the Array and returns it.
Returns the array in a randomized order
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 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
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.
Push an element to the beginning of an Array and return the new Array.
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.