Group Data by Value in Collection List?

Is it possible to automatically group different records in a collection list based upon a specified value?

For example, let’s say I have a number of courses, each belonging to a category. Can I set up the collection list to do something like this:

Category A
Course 1
Course 3
Course 5

Category B
Course 2
Course 4

If relevant, I am using Xano as my backend

1 Like

Hello @kyanaloe,

Yes, for sure. You could add a filter on your collection when you setup your collection or on the page when you bind the collection to your collection list.

Here’s a live office hour we did on how we created the WeWeb academy page.

It explains how we organized our data, fetched our list of lessons and courses in WeWeb, and filtered our list of lessons based on the course selected by the user.

In this case we’re using Airtable but the same logic would apply to Xano :slight_smile:

Here’s another live office hour we did, building a job board with WeWeb and Xano.

It explains how we filter through our list of jobs based on the job category selected by a user.

Does that help?

The videos have been very helpful! And the filtering capabilities of WeWeb are great and intuitive. I’ll rewatch the videos in case I missed the answer to my question. But I think the difference is that I want to Group dynamically. So I wouldn’t want to set up a few collection lists filtered by category. Rather, I am looking to have one collection list that can be grouped based on a dynamic value from the database.

I am setting up a multi tenant app, so some users might belong to an institution with 5 class categories, whereas another user’s institution might have 10 class categories, for example. So, I would need the grouping to be part of the repeating group.

Does that make sense?

I think I understand yes.

You would like to filter the data in the backend based on the user who is logged in your WeWeb app so that WeWeb only fetches the relevant information from Xano. Is that correct?

Yes, I do want to do that, and your videos have been great in helping me achieve that.

But the question is more about organizing the display. I suppose what I’m asking for is like an enhanced sort.

So, instead of it looking like this

Class 1 - Category A
Class 3 - Category A
Class 5 - Category A
Class 2 - Category B
Class 4 - Category B

It would have built-in headers like this:

Category A
Class 1
Class 3
Class 5

Category B
Class 2
Class 4