Xano Documentation
  • 👋Welcome to Xano!
  • 🌟Frequently Asked Questions
  • 🔐Security & Compliance (Trust Center)
  • 🙏Feature Requests
  • 💔Known Issues
  • Before You Begin
    • Using These Docs
    • Where should I start?
    • Set Up a Free Xano Account
    • Key Concepts
    • The Development Life Cycle
    • Navigating Xano
    • Plans & Pricing
  • The Database
    • Designing your Database
    • Database Basics
      • Using the Xano Database
      • Field Types
      • Relationships
      • Database Views
      • Export and Sharing
      • Data Sources
    • Migrating your Data
      • Airtable to Xano
      • Supabase to Xano
      • CSV Import & Export
    • Database Performance and Maintenance
      • Storage
      • Indexing
      • Maintenance
      • Schema Versioning
  • 🛠️The Function Stack
    • Building with Visual Development
      • APIs
        • Swagger (OpenAPI Documentation)
      • Custom Functions
        • Async Functions
      • Background Tasks
      • Triggers
      • Middleware
      • Configuring Expressions
      • Working with Data
    • Functions
      • AI Tools
      • Database Requests
        • Query All Records
          • External Filtering Examples
        • Get Record
        • Add Record
        • Edit Record
        • Add or Edit Record
        • Patch Record
        • Delete Record
        • Bulk Operations
        • Database Transaction
        • External Database Query
        • Direct Database Query
        • Get Database Schema
      • Data Manipulation
        • Create Variable
        • Update Variable
        • Conditional
        • Switch
        • Loops
        • Math
        • Arrays
        • Objects
        • Text
      • Security
      • APIs & Lambdas
        • Realtime Functions
        • External API Request
        • Lambda Functions
      • Data Caching (Redis)
      • Custom Functions
      • Utility Functions
      • File Storage
      • Cloud Services
    • Filters
      • Manipulation
      • Math
      • Timestamp
      • Text
      • Array
      • Transform
      • Conversion
      • Comparison
      • Security
    • Data Types
      • Text
      • Expression
      • Array
      • Object
      • Integer
      • Decimal
      • Boolean
      • Timestamp
      • Null
    • Environment Variables
    • Additional Features
      • Response Caching
  • Testing and Debugging
    • Testing and Debugging Function Stacks
    • Unit Tests
    • Test Suites
  • CI/CD
  • File Storage
    • File Storage in Xano
    • Private File Storage
  • Realtime
    • Realtime in Xano
    • Channel Permissions
    • Realtime in Webflow
  • Maintenance, Monitoring, and Logging
    • Statement Explorer
    • Request History
    • Instance Dashboard
      • Memory Usage
  • Building Backend Features
    • User Authentication & User Data
      • Separating User Data
      • Restricting Access (RBAC)
      • OAuth (SSO)
    • Webhooks
    • Messaging
    • Emails
    • Custom Report Generation
    • Fuzzy Search
    • Chatbots
  • Xano Features
    • Snippets
    • Instance Settings
      • Release Track Preferences
      • Static IP (Outgoing)
      • Change Server Region
      • Direct Database Connector
      • Backup and Restore
      • Security Policy
    • Workspace Settings
    • Advanced Back-end Features
      • Xano Link
      • Developer API (Deprecated)
    • Metadata API
      • Master Metadata API
      • Tables and Schema
      • Content
      • Search
      • File
      • Request History
      • Workspace Import and Export
      • Token Scopes Reference
  • Build With AI
    • Building a Backend Using AI
    • Get Started Assistant
    • AI Database Assistant
    • AI Lambda Assistant
    • AI SQL Assistant
    • API Request Assistant
    • Template Engine
    • Streaming APIs
  • Using AI Builders with Xano
  • Build For AI
    • MCP Builder
      • Connecting Clients
      • MCP Functions
    • Xano MCP Server
  • Xano Transform
    • Using Xano Transform
  • Xano Actions
    • What are Actions?
    • Browse Actions
  • Team Collaboration
    • Realtime Collaboration
    • Managing Team Members
    • Branching & Merging
    • Role-based Access Control (RBAC)
  • Agencies
    • Xano for Agencies
    • Agency Features
      • Agency Dashboard
      • Client Invite
      • Transfer Ownership
      • Agency Profile
      • Commission
      • Private Marketplace
  • Enterprise
    • Xano for Enterprise
    • Enterprise Features
      • Microservices
        • Ollama
          • Choosing a Model
      • Tenant Center
      • Compliance Center
      • Security Policy
      • Instance Activity
      • Deployment
      • RBAC (Role-based Access Control)
      • Xano Link
  • Your Xano Account
    • Account Page
    • Billing
    • Referrals & Commissions
  • Troubleshooting & Support
    • Error Reference
    • Troubleshooting Performance
      • When a single workflow feels slow
      • When everything feels slow
      • RAM Usage
      • Function Stack Performance
    • Getting Help
      • Granting Access
      • Community Code of Conduct
      • Community Content Modification Policy
  • Special Pricing
    • Students & Education
    • Non-Profits
  • Security
    • Best Practices
Powered by GitBook
On this page
  • append
  • count
  • diff / diff_assoc
  • intsersect / intersect_assoc
  • filter_empty
  • first
  • filter_empty_array
  • filter_empty_object
  • filter_empty_text
  • filter_false
  • filter_null
  • filter_zero
  • flatten
  • join
  • last
  • merge
  • merge_recursive
  • pop
  • prepend
  • push
  • range
  • remove
  • safe_array
  • shift
  • shuffle
  • slice
  • sort
  • unique
  • unshift
  • pick/unpick

Was this helpful?

  1. The Function Stack
  2. Filters

Array

Last updated 1 month ago

Was this helpful?

[
    {
        "name": "Chris"
        },
    {
        "name": "Shawn"
        }
]

append

Adds a new element to the end of the array, and return the updated array

Parameter
Purpose
Example

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

Example
Result

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:

value:


count

Returns the number of items in an array

Paremeter
Purpose
Example

parent value

The array to count

[1, 2, 3, 4, 5]

Example
Output

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.

Parameter
Purpose
Example

parent value

The first array to compare

[1, 2, 3, 4, 5]

value

The second array to compare

Same as above

Example
Output

Using diff: parent value: [1,2,3,4,5] value: [3,4,5,6,7]

[1, 2]

Using diff_assoc: parent value:

value:

Using intersect: parent value: [1,2,3,4,5] value: [3,4,5,6,7]

[3, 4, 5]

Using intersect_assoc: parent value:

value:


filter_empty

Returns a new srray with only entries that are not empty.

An empty value can be [], {}, 0, null, "", or false.

Parameter
Purpose
Example

parent value

The array to filter

[1, 0, 2, 0, 3]

path

When filtering arrays of objects, you can specify a path to optionally use a specific key to judge emptiness.

Example
Output

[1, 0, 2, 0, 3]

[1, 2, 3]


first

Get the first entry of an Array.

Parameter
Purpose
Example

parent value

The array to retrieve the first entry from

[1, 2, 3]

Example
Output

[1, 2, 3]

1


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.

Parameter
Purpose

parent value

The array or object to target

Example
Output

filter_empty_array

filter_empty_object

filter_empty_text

filter_false

filter_null

filter_zero


flatten

Flattens a multi-level array into a single-level array.

Parameter
Purpose
Example

parent value

The array to flatten

Example
Output

join

Converts an array into a text string by joining each value and using a separator.

Parameter
Purpose
Example

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

Example
Output

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.

Parameter
Purpose
Example

parent value

The array to get the last entry of

[1, 2, 3]

Example
Output

[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.

Parameter
Purpose
Example

parent value

The first array to merge

[1, 2, 3]

value

The second array to merge

[4, 5, 6]

Example
Output

using merge

parent value: ["a", "b", "c"] value: ["d", "e", "f"]

["a", "b", "c", "d", "e", "f"]

using merge_recursive

parent value:

value:


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.

🛠️
[
    {
        "name": "Chris"
        },
    {
        "name": "Shawn"
        }
]
{
        "name": "Cameron"
        }
[
    {
        "name": "Chris"
        },
    {
        "name": "Shawn"
        },
    {
        "name": "Cameron"
        }
]
[
    {"name": "Chris"},
    {"name": "Shawn"}
]
[
    {"name": "Chris"},
    {"name": "Shawn"}
]
[
    {"name": "Chris"},
    {"name": "Shawn"}
]
[
    {"name": "Chris"},
    {"name": "Shawn"},
    {"name": "Cameron"}
]
[
    {"name": "Chris"},
    {"name": "Shawn"}
]
[
    {"name":"Cameron"}
]
[
    {"name": "Chris"},
    {"name": "Shawn"}
]
[
    {"name": "Chris"},
    {"name": "Shawn"},
    {"name": "Cameron"}
]
[
    {"name": "Chris"},
    {"name": "Shawn"}
]
[
    {"name":"Chris"},
    {},
    {"name":"Shawn"}
]
[
    {"name":"Chris"},
    {},
    {"name":"Shawn"}
]
[
    {"name":"Chris"},
    {"name":"Shawn"}
]
[
    {"name":"Chris"},
    {"name":"Shawn"}
]
[
    {"name":"Chris"},
    {"name":"Shawn"}
]
{"name":"Chris"}
{
        "title": "",
        "name": false,
        "width": 0,
        "items": [],
        "data": {},
        "info": null
}
{
        "title": "",
        "name": false,
        "width": 0,
        "data": {},
        "info": null
}
{
        "title": "",
        "name": false,
        "width": 0,
        "items": [],
        "data": {},
        "info": null
}
{
        "title": "",
        "name": false,
        "width": 0,
        "items": [],
        "info": null
}
{
        "title": "",
        "name": false,
        "width": 0,
        "items": [],
        "data": {},
        "info": null
}
{
        "name": false,
        "width": 0,
        "items": [],
        "data": {},
        "info": null
}
{
        "title": "",
        "name": false,
        "width": 0,
        "items": [],
        "data": {},
        "info": null
}
{
        "title": "",
        "width": 0,
        "items": [],
        "data": {},
        "info": null
}
{
        "title": "",
        "name": false,
        "width": 0,
        "items": [],
        "data": {},
        "info": null
}
{
        "title": "",
        "name": false,
        "width": 0,
        "items": [],
        "data": {}
}
{
        "title": "",
        "name": false,
        "width": 0,
        "items": [],
        "data": {},
        "info": null
}
{
        "title": "",
        "name": false,
        "items": [],
        "data": {},
        "info": null
}
[
  [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"
  }
]
{
    "a": "test",
    "b": ["a","b"]
}
{
    "c": "hi",
    "b": ["c","d"]
}
{
    "a": "test",
    "b": ["a","b","c","d"]
    "c": "hi",
}

NOTE

When a filter below refers to the parent value, we're talking about the value box that lives immediately above the filter.

Example Object
Defining the Keys we want to include in our new object.
Result
Example Object
Defining the Keys we want to exclude from our new object.
Result