Data Management

Easy Array Manipulation in Xano | No more loops or Lambdas required!

If you've ever wrestled with loops or Lambda functions just to transform an array in Xano, you're going to love what's been added to the platform. Six new array manipulation functions — Map, Partition, Group By, Difference, Intersection, and Union — are now available in the visual builder, and they make data transformation dramatically faster and cleaner.

Map: Transform Every Element in an Array

The Map function lets you transform each element in an array without building a separate loop in your function stack. When you add it under Data Manipulation > Arrays, you'll pass in your array and choose an output type — either an array of values or an array of objects. You get access to two helpful keywords: this, which represents the current item, and index, which represents its position. For example, you can use a concat filter to combine this and index with a dash separator, turning [1, 2, 3] into [1-0, 2-1, 3-2]. It's a simple demo, but the possibilities for reshaping your data are significant.

Partition: Split an Array into True and False Buckets

Partition is one of the most immediately useful additions. It evaluates an expression for each element and sorts items into a true bucket or a false bucket based on the result. For instance, passing in [1, 2, 3] with the condition this < 3 will place 1 and 2 in the true bucket and 3 in the false bucket. You can then use each bucket independently in the rest of your workflow.

Group By: Organize Array Items Around a Key or Expression

Group By lets you reorganize an array of objects by grouping them around a shared value. Using a products array, you can group items by stock_quantity, and each unique quantity value becomes a key containing all matching products. You can also pass in an expression — like this < 50 — to group items into two buckets: those that meet the condition and those that don't. It's a flexible tool for segmenting your data in meaningful ways.

Difference, Intersection, and Union: Compare Two Arrays at Once

These three functions let you work across two arrays without writing any custom filter logic.

  • Difference returns values found in the first array but not the second. If your first array is [1, 2, 4] and the second is [1, 2, 3], you get back [4].
  • Intersection returns only the values shared by both arrays. Using the same example, you'd get [1, 2].
  • Union combines both arrays and keeps only unique values, so [1, 2, 4] and [1, 2, 3] produce [1, 2, 4, 3]. You can even chain a sort filter on the output to return values in ascending order.

Together, these six functions give you a clean, efficient toolkit for handling nearly any array transformation your workflows require — no extra loops needed.

Sign up for Xano

Join 100,000+ people already building with Xano.
Start today and scale to millions.