Best Approach to Setting Up a Hierarchical List / Outline Numbering / Tree Structure in Glide

Hi everyone,

I’m developing an app to manage a large set of requirements, and I’m looking for advice on the best way to implement a Hierarchical List or Tree Structure. Each requirement has a parent (main section) and, optionally, a grandparent (subsection). While the ability to go multiple levels deep would be great, it’s not essential for this particular project.

Key Considerations:

  • Screen real estate: To keep the UI clean and uncluttered, I want to avoid using extra columns to visualize the main section and subsection for each item. Instead, I’d like to use a Hierarchical List for better organization and clarity. (Screenshots attached below for reference.)

Requirements:

  1. Each item should have a parent, and potentially a grandparent, as well as siblings and an index.
  2. When a new item is added, it must automatically:
  • Be assigned a parent (unless it’s a main section).
  • Receive the next available index within its parent section.
  1. When an item is removed, the indexes of the remaining items should automatically recalculate.
  2. Items should be re-assignable to a different parent, with indexes recalculating accordingly.
  3. Items should be reorderable (moved up or down) within their sibling list.

Attempts So Far:

  • Approach 1:
    This method meets all the requirements above but has significant performance issues. It’s slow to load and heavily reliant on calculated rows, making maintenance more complex.
  • Approach 2:
    This system is much faster but doesn’t support automatic recalculation of indexes when items are removed or reassigned to a new parent.

What I Need Help With: Before spending more time experimenting, I’d love to hear how you experts might tackle this challenge. Would a JavaScript column be a potential solution for this use case? Should I migrate to SQL? Or has anyone successfully implemented a similar setup in Glide that balances performance and functionality?

Any advice, best practices, or examples would be greatly appreciated. Thanks so much for your help!


Hola Tim,

I think your case points to “when to use a SQL or NoSQL database”. This article can help you a lot

Many times we want to create our APP using a SQL structure in Glide and it’s is fine (although Firebase, the core of Glide Tables, is a NoSQL database :upside_down_face:) but sometimes use JSON to gather and search data is a better idea and fastest solution.

It all depends on your needs.

Saludos y feliz navidad Tim!

1 Like

Your case is complex, but you might want to look into this method for reordering.

However I’m not sure how it blends in with your automatically generated index.

1 Like