Skip to main content
NOTEWhen a filter below refers to the parent value, we’re talking about the value box that lives immediately above the filter.

fill

Create an array of a certain size with a default value.
ParameterPurposeExample
parent valueThe default value to fill”default value”
startThe starting index of the array0
lengthThe number of items in the array10

Examples

  • Example
  • Result

fill_keys

Creates an object of a certain size with a default value and a list of keys.
ParameterPurposeExample
parent valueThe default value to fill”default value”
keysThe array of keys to use[ "key1", "key2", "key3"]

Examples

  • Example
  • Output

first_notempty

Applies the first value that is not empty (0, null, "", empty string) Useful if you need to determine a value to apply based on what is provided, such as editing a database record and being uncertain if an input will be provided to replace a value.
ParameterPurposeExample
parent valueThe value to check if emptyCan contain any value, or no value.
valueThe value to use if the parent value is empty”default”

Examples


first_notnull

Applies the first value that is not null Useful if you need to determine a value to apply based on what is provided, such as editing a database record and being uncertain if an input will be provided to replace a value.
HintRemember, null is its own value entirely. It is not the same as “null”, an empty string, or any other similar empty state.
ParameterPurposeExample
parent valueThe value to check if nullCan be any value
valueThe value to use if the parent value is null”default”

Examples


get

Gets a value at the specified path inside of an array or object. For arrays, the path can be an index, such as 0, 1, or 2, which will get the specific item at that index in the array. For arrays of objects, you can specify the index + a path, such as 2.name For single objects, you can just specify the path, such as name. This filter is useful if you aren’t sure if the value you need will exist, and need to provide a default value in place of it.
HintAre you getting errors in your function stacks because certain values don’t exist all the time? The GET filter can be a great fix for this.
ParameterPurposeExample
parent valueThe object or array to search for the valueThis can be an object, array, a variable, or the result of one of the Get All Input functions [1] [2]
pathThe path to look for inside of the parent valueFor getting a specific array item: 0 For getting a specific path inside of an object: pathName For getting a specific path inside of an array of objects: 0.pathName
default valueThe value to provide in place of the value that isn’t foundThis value can be whatever you’d like.

Examples

An age is provided in the input, so it is provided by the GET filter.

No age is provided in the input, so the default value is used instead.


has

Checks if a value is present (similar to get), but only returns a true or false.
ParameterPurposeExample
parent valueThe object or array to search for the valueThis can be an object, array, a variable, or the result of one of the Get All Input functions [1] [2]
pathThe path to look for inside of the parent valueFor getting a specific array item: 0

For getting a specific path inside of an object: pathName

For getting a specific path inside of an array of objects: 0.pathName

Examples

An age is provided, so the filter returns true

An age is not provided, so the filter returns false


set

Replaces or inserts new data at a specified path.
ParameterPurpose
parent valueThe object or array to target with the set filter
pathThe path at which to insert the supplied value
valueThe supplied value to use

Examples

Replace a value with another

Set a new key inside of an object


set_conditional

Use set_conditional to set a new value in an object based on whether a condition evaluates as true.
ParameterPurpose
parent valueThe data to insert the result, such as an object
pathThe path to insert the result
valueThe value to insert at the specified path
conditionalThe condition to check. This can either come from an earlier function,or another filter that returns a true or false

Examples

The age provided is greater than 20, so we return the value set in our set_conditional filter


set_ifnotempty

set_ifnotnull

Sets a new value in an object if the value provided is not empty. An empty value can be 0, null, or an empty string. set_ifnotnull works the same, but only checks for null
ParameterPurposeExample
parent valueWhere to set the valueThis will usually be an existing object
pathThe path to set the value if the checked value exists”name"
"age"
"location”
valueThe value to set if the checked value is not empty (or null)Any value

Examples

1

First, we're getting an existing record from the database.

In this function stack, we’re simulating a user submitting changes to their user profile.
2

Then, we use an Update Variable with set_ifnotempty (or set_ifnotnull) to determine whether or not the returned record needs to be updated.

3

Finally, we edit the record using the result of step 2 for all of our values.


transform

The transform filter is universal way to transform data. It works with arrays, objects, and scalar values. It uses the expression data type to specify the transformation.

Hint

This filter is similar to the map filter, except it can bind to all data - not just an array. You can use the context variable $$ to target the parent value.
ParameterPurposeExample
parent valueThe value to apply the transformation toCan be any value or variable
expressionThe expression to runAny expression
Read more about expressions and Xano Transform below.

Expression

Xano Transform

Examples

[1,2,3]|transform:($$|count)                              // returns 3
[1,2,3]|transform:($$|count)+($$|sum)                     // returns 9
{first:Alpha,last:Beta}|transform:$$.first~" "~$$.last    // returns Alpha Beta

unset

Removes a key from an object
ParameterPurpose
parent valueThe object to target
pathThe name of the key to remove from the object

Examples

The user record normally returns a "name", but using unset has removed it.


I