How to order or sort a parent/child list in descending order

I have a repeating group in which I need to display my list in descending order.

The top cell should including all items in the database in which the parent cell is empty. The next cell would contain all items with the parent id of the previous cell, and so on.

Wondering how to sort a list this way in bubble?

Thanks

Could you more clarify what you’re trying to do?

1 Like

So I have this data set. As you can see, each user has a “Reports to” field with the unique Id of the person they report to (and users with this field empty are at the top of the list). I’m trying to sort this list of users in order of people based on who they report to.

So you want the row that has empty “reports to” to appear first, right? I don’t know if this is the best method. but you can create a field called “haveReportTo” that has data type yes/no. so the rows that have a user in the “report To” field would have their “haveReportTo” field set as “yes” and those that have an empty “report To” would have their “haveReportTo” field set as “no”. then you can be able to sort by “haveReportTo”, descending: “no”.

Thanks for the response,

Aswell as this I still want to sort the users further with the report to feature.

I’m looking to create an organisational chart type structure, but without the chart.

Can you explain how you want to futher sort the users with the “reports to” field?

If you were to graph the list, it would look something like this. The top row has an empty “Reports to” field, and then the next row “reports to” field contains the IDs of the users in the row above it, and so on.

I am essentially trying to get each row to show in a repeating group

So in the repeating group that is displayed vertically, cell 1 would contain only Sydney, cell 2 would contain both Jack and the guy next to him Nelson, cell 3 would contain Billy, Caitlin, Maddy, Adam, etc, and cell 4 would contain Fred etc, right?

Yes exactly, and as you can see in the screenshot of the database layout above, this kind of structure can be created because of the “report to” field that contains the Id of the person they report to

Thanks for your continued response and help aswell :slight_smile:

I would suggest you create a table called EmployeeRanking. That has field: name(text e.g ranking 1, ranking 2, ranking 3), order(number e.g 1, 2, 3) and employees (list of users).
Then the users table can have a field called employeeRanking that reference the employeeRanking table (where you can state which ranking a particular user belongs to). Then in your editor, you can create a repeating group of type employeeRanking, sort by order number. And in each cell of the repeating group you say “currentcell employeeRanking users name”. That is all.

So the ceo user would be in the ranking 1.
The cfo user and the guy beside him would be in the ranking 2.
The site technical, intern, plumber, head of marketing users would be in the ranking 3. The it goes on and on.

Any other person can contribute to this, as we are all open to learning.

1 Like

Thanks for your help,

This is definately a solution and something I will probably implement. Thanks for your help :slight_smile:

1 Like