Xano <> Adalo: Grouped by Output not showing up in Adalo

I have a grouped output from Xano that shows up perfectly in Xano, Postman, and when I add the collection to Adalo.

When I add the collection to an Adalo custom filter, the information appears incorrect and is all the same.

Does anyone have a solution?

It might be because the API response has no ID, so Adalo can’t iterate through them. Try adding an ID property to the array.

1 Like

Hey @theadaloguy - Thanks for the recommendation. The issue is that if I add the ID property to the “Grouped by” list of fields within the output return, the separate performances are no longer grouped. Since their Xano table IDs are unique, they all become separated again, which I don’t want.

Do you know how I would add unique IDs to the aggregated output?

You can loop through the returned array, adding IDs.


I created a variable x1 here to represent an array. In your case, it will be the array in your response. I create a counter variable starting at 1, to give each item a different ID. On each loop, i update variable item.id to be counter, and the update the counter to be counter +1.

Thanks for the guidance @theadaloguy . Where would you recommend I add this new counter variable to the Aggregated data table output?

The current function stack:

The Aggregated Data Table output:

@theadaloguy, actually, I figured it out. But now I need to reorder the output so the counter variable is the first field in the output.

Good question, I looked this up on the Xano community using their AI chat feature which searches the Xano forum (I recommend using it). I pasted the full ai response below, but i think basically on each loop, you build the object, as you can choose how to structure the object precisely.

To reorder keys in a JSON object in Xano, you can use the Create Object function and specify the order of the keys manually. Here is a step-by-step guide:

  1. Create a New Variable: First, create an empty variable to store your reordered JSON object.
  2. Get Values from the Original JSON Object: Extract the values you need from your original JSON object.
  3. Create a New JSON Object with Ordered Keys: Use the Create Object function to create a new JSON object with the keys in the desired order.

Here is an example:

{
  "id": 123,
  "name": "John Doe",
  "email": "john.doe@example.com"
}

If your original JSON object looks like the one above but the id key comes last, you can reorder it like this:

{
  "id": 123,
  "name": "John Doe",
  "email": "john.doe@example.com"
}

Here are the steps in Xano:

  1. Create an Empty Object:

    • Add a Create Variable function and initialize it as an empty object {}.
  2. Extract Values from the Original JSON Object:

    • Use the Get Values function to get the values of id, name, and email.
  3. Create a New JSON Object with Ordered Keys:

    • Use the Create Object function to create a new JSON object with id as the first key.

Here is a rough outline of the function stack:

{
  "functions": [
    {
      "type": "create_variable",
      "name": "new_object",
      "value": {}
    },
    {
      "type": "get_values",
      "input": "original_object",
      "output": "values"
    },
    {
      "type": "create_object",
      "keys": ["id", "name", "email"],
      "values": [
        "values.id",
        "values.name",
        "values.email"
      ],
      "output": "new_object"
    }
  ]
}

This will create a new JSON object with the keys in the order you specified, with the id key coming first.

The AI response is slightly confusing, but just create your empty array X1, loop through your aggregated response and build the object for each item.

So you’ll update variable (item) to be item push {} empty object

  • set id
  • set field 2
  • set field 3
  • set field 4
    etc.

Hope that makes sense

Thanks a ton. I’ll give it a try. I must have stated my prompt in the AI chat bot because it gave me a very different and functionally impossible-to-action recommendation.

1 Like