Xano Documentation
Search…
πŸ’‘
Start here
☁️ Your Xano Account
πŸ’²
Special Discount Pricing
Manipulation Filters
  • first_notempty - returns the first value that is not empty
  • first_notnull - returns the first value that is not null
  • set_ifnotempty - Good for updating objects.
  • set_ifnotnull - Similar to above, but useful for when you are dealing with null values.
For all examples of these filters we will use the same Object: { "a":"1", "b":"2", "c":"3" }
coalesce This is a special SQL filter for handling null values. It will provide an alternative value for null values. This may especially come in handy for sorting with joined data.
In this example, coalesce is applied to this eval of merchant_id. This allows us to provide an alternative value for null, which in this case is defined as 0.
​
The below example shows the query results when sorted in descending order by deal.merchant_id WITHOUT a coalesce filter applied.
In this example, there is no coalesce filter and the null values will come first when sorting by descending order. And last when sorting by ascending order.
​
With the coalesce filter applied, the null value takes on the substituted value.
In this example, we applied the coalesce filter to make null values take a value of 0. Now, when we sort by descending order the previously null values come last because they take on the value of 0.
entries Get the property entries of an object as an array of key/value pairs.
get Returns the value of an object at the specified path, the path is the key of each pair, in this example, the path could be: a, b, or c.
In this example, we apply the get filter with the path of a and the variable becomes 1.
has Returns the existence of whether or not something is present in the object at the specified path, the path is the key of each pair, in this example the path could be: a, b, or c. This filter returns a value of true or false.
In this example, we apply the has filter with the path of c and the variable becomes true.
keys Get the property keys of an object as an Array.
In this example, we apply the keys filter with the path of c and the variable becomes an array of [ "a", "b", "c"]
set Sets a value at the path within the object and returns the updated object.
In this example, we use the set filter to create an object { "a":"1", "b":"2", "c":"3" }.
unset Removes a value at the path within the object and returns the updated object.
In this example, we use the unset filter to create an object { "a":"1", "c":"3" }.
values Get the property values of an object as an Array:
In this example, we apply the values filter with the path of c and the variable becomes an Array of [ "1", "2", "3"].
Last modified 1mo ago
Copy link