# Categories and subcategories - How to

**URL:** <https://community.glideapps.com/t/categories-and-subcategories-how-to/81069>\
**Category:** Ask for Help\
**Created:** [March 30, 2025, 11:40pm UTC](https://community.glideapps.com/t/categories-and-subcategories-how-to/81069 "2025-03-30T23:40:55Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phamik](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/phamik/32/86639_2.png) [@Phamik](https://community.glideapps.com/u/Phamik)\
**Post date:** [March 30, 2025, 11:40pm UTC](https://community.glideapps.com/t/categories-and-subcategories-how-to/81069/1 "2025-03-30T23:40:55Z")

</div>

Hello,

Im very new to this so i will try to explain the best i can.

I have a list of products that go into different categories, subcategories and 2nd subcategory (sub-sub category?). My problem is that some items do not have the 2nd subcategory and only belong into subcategory.

Example:  
I have these products:  
Product1  
Product2  
Product3

CATEGORY \> SUBCATEGORY 1 \> PRODUCT 1, PRODUCT 2  
CATEGORY \> SUBCATEGORY 2 \> 2ND SUBCATEGORY \> PRODUCT 3

So to find Product 1 and 2 ill have to navigate through 2 folders and for product 3 I will have to navigate through 3 folders. I have already done the folders for SUBCATEGORY 1, 2 in my app by watching the Things in Things video, but I have no idea what to do next.

Thank you for help, I hope my explanation makes sense.

---

<div class="post-metadata">

**Author:** ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)\
**Post date:** [March 31, 2025, 9:18am UTC](https://community.glideapps.com/t/categories-and-subcategories-how-to/81069/2 "2025-03-31T09:18:02Z")

</div>

How about trying something like this:

| Parent | Child |
| --- | --- |
| CatA | CatB |
| CatB | Prod1 |
| CatB | Prod2 |
| CatC | CatD |
| CatD | Prod3 |

Basically, you create a tree structure with as many levels as you want (you could add CatE, CatF, …), each edge (branch of the tree) is defined in a single row by who the child and who the parent is.

---

<div class="post-metadata">

**Author:** ![Phamik](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/phamik/32/86639_2.png) [@Phamik](https://community.glideapps.com/u/Phamik)\
**Post date:** [March 31, 2025, 5:43pm UTC](https://community.glideapps.com/t/categories-and-subcategories-how-to/81069/3 "2025-03-31T17:43:26Z")

</div>

I tried making these 2 columns, but the problem is that the subcatecory CatB appears 2 times in the main category section

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/1/7123ad19d9e6e3d0534504c80928ad82ca83d1a2.png)

---

<div class="post-metadata">

**Author:** ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)\
**Post date:** [March 31, 2025, 8:49pm UTC](https://community.glideapps.com/t/categories-and-subcategories-how-to/81069/4 "2025-03-31T20:49:54Z")

</div>

Now create a separate table just with the top level categories. In this table, create a relation to the parent-child tree table.

---

<div class="post-metadata">

**Author:** ![Phamik](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/phamik/32/86639_2.png) [@Phamik](https://community.glideapps.com/u/Phamik)\
**Post date:** [March 31, 2025, 11:20pm UTC](https://community.glideapps.com/t/categories-and-subcategories-how-to/81069/5 "2025-03-31T23:20:28Z")

</div>

I still dont really get it, I made a new table with the main categories (catA, catC?) and then make  
a column in the new table that relates to the parent or the child column? do you have any guide or templates i could look at? I think ill understand once i see an example.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [April 1, 2025, 2:18am UTC](https://community.glideapps.com/t/categories-and-subcategories-how-to/81069/6 "2025-04-01T02:18:58Z")

</div>

Would something like this work?

### Table 1: Categories

| **Category ID** | **Category Name** |
| --- | --- |
| CAT001 | CATEGORY 1 |
| CAT002 | CATEGORY 2 |

* * *

### Table 2: Subcategories

| **Subcategory ID** | **Category ID** | **Subcategory Name** |
| --- | --- | --- |
| SUB001 | CAT001 | Subcategory 1 |
| SUB002 | CAT002 | Subcategory 2 |
| SUB003 | CAT002 | Subcategory 3 |

* * *

### Table 3: 2nd Subcategories (Sub-Subcategories)

| **2nd Subcategory ID** | **Subcategory ID** | **2nd Subcategory Name** |
| --- | --- | --- |
| SUBSUB001 | SUB003 | 2nd Subcategory 3.1 |

* * *

### Table 4: Products

| **Product ID** | **Product Name** | **Subcategory ID** | **2nd Subcategory ID (FK)** |
| --- | --- | --- | --- |
| PROD001 | Product 1 | SUB001 | |
| PROD002 | Product 2 | SUB001 | |
| PROD003 | Product 3 | SUB003 | SUBSUB001 |

---

<div class="post-metadata">

**Author:** ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)\
**Post date:** [April 1, 2025, 12:59pm UTC](https://community.glideapps.com/t/categories-and-subcategories-how-to/81069/7 "2025-04-01T12:59:51Z")

</div>

**How to create a tree structure**

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/8/b8d8cf22f4ab3199c9def5675b45745618330fad.png)

I think Thinh’s recommendation above will work well with a somewhat limited number of subcategories, since each new subcategory requires a new table, and if each table represents different objects with different attributes. For example, Company → Business Units → Departments → Teams → Employees → Projects → Tasks

The attributes of a Company, of a Team, or of an Employee are presumably very different and each object would therefore warrant its own table.

If objects in the hierarchy are the same, or said differently, if the categories are simply a way of categorizing the objects and navigating through a tree hierarchy, then you can set up a tree structure in a single table.

For example, CEO → VPs (CEO’s subordinates) → Directors (subordinates of VPs) → Team leads (subordinate of directors) → Senior managers (subordinates of team leads) → etc. The objects here are the same: an employee, in an Employees table.

Each additional row in the table will add a branch or segment in the tree and it is easy to make the tree as flat or deep or bushy as needed by adding rows.

 ![Screenshot 2025-04-01 at 15.09.55](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/c/9c542b9d34770ba2f23c26d4e5c0312c80326ef1.jpeg)

In the Data Editor:

- You will need a parent column, a child column, and a Relation column relating child to parent match multiple.
- Optional: Row ID.

In the Layout Editor:

- Setup the collection with the table as the data source, display data from the child column, and filter to only display the top nodes (top categories). The top nodes need to be in the child column. The parent of the top nodes can be called root or even left empty. The optional row ID column can come in handy for the filter. Display data from the child column.
- Set the collection item click to Show Details Screen.
- On the details screen, add a collection. Set the data source to the Parent→Child relation. Display data from the child column.

That’s it. Now you can navigate through your categories and subcategories.

**Note about top level categories**  
There would be different ways to display the initial top nodes (top categories). In the method above I filtered in the layout editor. It would also be possible to create a separate table for them, or to create a Query column and apply the filter in the data editor rather than in the layout editor.

 ![Screenshot 2025-04-01 at 14.33.06](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/9/995dca81fff976966d12d1af9ac9e53c7396389f.jpeg)  
 ![Screenshot 2025-04-01 at 14.37.08](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/d/bd7bd9a52559e085a67702ebb100d9dd8208a2b4.png)  
 ![Screenshot 2025-04-01 at 14.38.52](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/d/dd86cef741a5465de842b0c81e6449af49268b58.jpeg)

---

<div class="post-metadata">

**Author:** ![Phamik](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/phamik/32/86639_2.png) [@Phamik](https://community.glideapps.com/u/Phamik)\
**Post date:** [April 1, 2025, 7:28pm UTC](https://community.glideapps.com/t/categories-and-subcategories-how-to/81069/8 "2025-04-01T19:28:43Z")

</div>

Thank you! I have been playing with it for a little bit and now I understand it. I will try Thinh’s recommendation too when I get the time for it. But now I have a new sheet with a masterlist of all products. How would I put them in the end folder (category where the products belongs in)?

---

<div class="post-metadata">

**Author:** ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)\
**Post date:** [April 1, 2025, 7:30pm UTC](https://community.glideapps.com/t/categories-and-subcategories-how-to/81069/9 "2025-04-01T19:30:13Z")

</div>

Copy-paste from Excel or Google Sheets, or a CSV upload.

---

<div class="post-metadata">

**Author:** ![Phamik](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/phamik/32/86639_2.png) [@Phamik](https://community.glideapps.com/u/Phamik)\
**Post date:** [April 1, 2025, 7:35pm UTC](https://community.glideapps.com/t/categories-and-subcategories-how-to/81069/10 "2025-04-01T19:35:59Z")

</div>

Yes, i have done that, now how do i put them in categories they belong to?

---

<div class="post-metadata">

**Author:** ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)\
**Post date:** [April 1, 2025, 7:37pm UTC](https://community.glideapps.com/t/categories-and-subcategories-how-to/81069/11 "2025-04-01T19:37:51Z")

</div>

What are the items you are putting into categories and sub-categories? Could you give a few examples of item names, categories and sub-categories?

---

<div class="post-metadata">

**Author:** ![Phamik](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/phamik/32/86639_2.png) [@Phamik](https://community.glideapps.com/u/Phamik)\
**Post date:** [April 1, 2025, 8:35pm UTC](https://community.glideapps.com/t/categories-and-subcategories-how-to/81069/12 "2025-04-01T20:35:58Z")

</div>

I made a quick example hope you understand

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/5/658c9ce38e84c03f08df77dadc2c826d3d6acc8f.png)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/3/b3abc16dff0fe6f3e179fa2beb1596f77e812f68.png)

---

<div class="post-metadata">

**Author:** ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)\
**Post date:** [April 1, 2025, 8:53pm UTC](https://community.glideapps.com/t/categories-and-subcategories-how-to/81069/13 "2025-04-01T20:53:52Z")

</div>

Okay so you are categorizing products. You can use the method I explained above. It’s a little lengthy, but follow the instructions exactly. You could copy column names you see in the screenshots.

---

<div class="post-metadata">

**Author:** ![Phamik](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/phamik/32/86639_2.png) [@Phamik](https://community.glideapps.com/u/Phamik)\
**Post date:** [April 2, 2025, 8:06pm UTC](https://community.glideapps.com/t/categories-and-subcategories-how-to/81069/14 "2025-04-02T20:06:11Z")

</div>

So id have to add each product like this manually? That can be a bit lenghty if you have 100s of products. But it will do for now thanks!

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/7/37da7b3a1b2a0f618889cae851b40fff75dc34e8.png)

---

<div class="post-metadata">

**Author:** ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)\
**Post date:** [April 3, 2025, 9:30am UTC](https://community.glideapps.com/t/categories-and-subcategories-how-to/81069/15 "2025-04-03T09:30:09Z")

</div>

In my post above above, I changed the tree diagram for clarity. You now see the numbers to understand what’s going on.

Remember this: all nodes in the tree diagram are a child. The only exception is the root node (0).

So in your case, all categories, subcategories, sub-subcategories and products need to be in the child column. All of them.

Now in the parent column, indicate who the parent is. Only one single node does not have a parent (call that root master or 0 or leave it empty, it doesn’t matter what you call it because it won’t appear anywhere).

On a given row, you will only have one parent and one child. There are no comma-separate lists or arrays.

Then set up your relation. Check the relation is indeed pointing the the correct rows. By looking at your table, you should be able to visualize the tree of main categories, subcategories, sub-subcategories and products.

In my example above, you see the following:

- Row 1. Child is 1. The relation points to 3 rows. When I inspect these 3 rows (the bubbles with 3 1’s), I see that the children of node 1 are the nodes 5, 6, 7. This is coherent with the tree diagram.
- Row 2. Child is 2. The relation points to 2 rows. When I inspect these 2 rows (the bubbles with 2 2’s), I see that the children of node 2 are the nodes 8 and 9. This is coherent with the tree diagram.
- Let’s skip a few rows. Row 5. Child is 5. The parent is 1. The relation points to 1 row. When I inspect this row (the bubbles with a 5), I see that the child of node 5 is node 11. This is coherent with the tree diagram.
- And so on.

At the end of the day, the setup is quite straightforward:

1. Two columns: one child that contains all categories and products, one parent that indicates the parent of each category product
2. A relation, to create the ability to navigate from row to row.
3. A filter, either in the data editor or layout editor, to display the top categories only
4. A collection with the relation as a data source on the details page of the top category

---

<div class="post-metadata">

**Author:** ![Phamik](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/phamik/32/86639_2.png) [@Phamik](https://community.glideapps.com/u/Phamik)\
**Post date:** [April 3, 2025, 8:57pm UTC](https://community.glideapps.com/t/categories-and-subcategories-how-to/81069/16 "2025-04-03T20:57:06Z")

</div>

I tried this today but i dont know how to put the PROD003 into SUBSUB001, because when making the relations PROD003 goes into SUB003

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [April 3, 2025, 11:51pm UTC](https://community.glideapps.com/t/categories-and-subcategories-how-to/81069/17 "2025-04-03T23:51:43Z")

</div>

How are you creating the relation?

---

<div class="post-metadata">

**Author:** ![Phamik](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/phamik/32/86639_2.png) [@Phamik](https://community.glideapps.com/u/Phamik)\
**Post date:** [April 4, 2025, 8:22pm UTC](https://community.glideapps.com/t/categories-and-subcategories-how-to/81069/18 "2025-04-04T20:22:36Z")

</div>

This is how I currently have my sheet setup.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/d/1dfb900be9a041abc54e0486c421f4c883077c39.png)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/6/26895427cbaeabfeee6cca1b2a84778dcd4c77c3.png)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/a/5/a51afb9c33351215a957d2ba0df3e84b12d3fc00.png)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/4/04417a4e0c68df4ac8837682f106038e1e611f9a.png)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/1/21d693388a85deff41aff9b79cfdaf0e3e2e173f.png)

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [April 5, 2025, 12:01am UTC](https://community.glideapps.com/t/categories-and-subcategories-how-to/81069/19 "2025-04-05T00:01:12Z")

</div>

Am I correct in assuming what you want is a list of products on each level, AND a list of child categories on each level?

---

<div class="post-metadata">

**Author:** ![Phamik](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/phamik/32/86639_2.png) [@Phamik](https://community.glideapps.com/u/Phamik)\
**Post date:** [April 5, 2025, 4:44pm UTC](https://community.glideapps.com/t/categories-and-subcategories-how-to/81069/20 "2025-04-05T16:44:17Z")

</div>

I explained it above what i am looking for:

CATEGORY \> SUBCATEGORY 1 \> PRODUCT 1, PRODUCT 2  
CATEGORY \> SUBCATEGORY 2 \> 2ND SUBCATEGORY \> PRODUCT 3

So to find Product 1 and 2 ill have to navigate through 2 folders (CATEGORY \> SUBCATEGORY) and for product 3 I will have to navigate through 3 folders (CATEGORY \> SUBCATEGORY \> SUBSUBCATEGORY)

I hope you understand my explanation

Nathanaels suggestion works well. But I want to try your suggestion too.

[Next page](https://community.glideapps.com/t/categories-and-subcategories-how-to/81069.md?page=2)
