Hi all I am trying to set up a Google Sheet with AppSheet and im having a really difficult time working out how to make subcategories work. There doesnโt seem to be any app examples that have subcategories - anyone know of any?
I have categories, then subcategories, then subsubcategories, then subsubsubcategories. So for example the category Planet then has the subcategory Countries then subsubcategory Cities then subsubsubcategory Streets.
I canโt figure out how to do this :-((
toby
Unfortunately your explanation of the issue is not clear at all. Explicitly where do you have those categories, what are they, where do you want to use or display them? What are the issues you are experiencing? Where you are experiencing those issues: Form View, Detail View etc.? Please elaborate your problem.
Sorry. I meant that I have a table called ITEMS. And in that is a big list of objects - for an inventory. I have categories for each of these items, and within those I have subcategories etc. I wasnโt sure how to do that. So at the moment inside the table ITEMS, I have a column CATEGORY, then a column CATEGORYSUB, then a column CATEGORYSUBSUB, and a column CATEGORYSUBSUBSUB. And each of those are set to be REFS, sourcing from separate tables - I have a table called CATEGORIES, a table CATEGORYSUBS, a table CATEGORYSUBSUBS and a table CATEGORYSUBSUBSUBS. Thatโs how Iโve built it, as I wasnโt sure how else to do it. And then inside those tables, they are refโd to each other. Does that make sense?
For more info: Inside the โCATEGORIESโ table, I have columns _RowNumber, CategoryID, CATEGORY, CATEGORY IMAGE, IMPORTANT and Related ITEMSs that last one was autogenerated by AppSheet).
Iโm happy to change the way Iโve built it - Iโm asking to find out how best to store and use โsubcategoriesโ and โsubsubcategoriesโ etc for items in the database.
The app Iโm making then should have โCATEGORIESโ as an option at the bottom, then you see a list of all the main categories. You click one, and it shows the subcategories. You click again and you see the subsubcategories. Then again to see the subsubsub categories. Ideally at each point youโd see all the products that are have no further subcategories. The way a normal inventory app does it, I guess.
@tobyinla
Your approach to reference the tables with each other is correct as they actually related to each other. But however, I couldnโt understand where the problem is. In the table view, when a certain row is clicked, it goes to the Detail View of that record. Instead of the Detail view, do you want it to show the table for the next sub-category?
Iโm talking about the behavior the final app - not the behavior of the AppSheet interface. When I make a view, I want it to show all categories, then a user clicks that and it shows all the subcategories - and also show all items that are in that main category but donโt have a subcategory. Etc etc Does that make sense?
@tobyinla
I was talking about the same if you pay attention to what I have said. What you are expecting is totally doable and is a very simple thing to do in many aspects. It totally relies on how you want to do it actually. There are a couple of different ways to accomplish what you want.
OK great. Would love to know how to do it. Did I offend you somehow? You seem quite angry.
No, no not at all. Sorry if it seemed that way. You can drill this in a couple of ways as I have said. The easiest and more direct way is:
Instead of the CATEGORIES table, put the PRODUCTS table. And in the table structure use GROUPED BY option and group that table as per:
You can also apply a Format Rule to these so that it will look nice in the UI. And in the table view, when the user clicks the PRODUCT icon, the table will show in bold CATEGORY >, when clicked it will drill down and show all the names from the CATEGORYSUBS, when one of them clicked, it will show names from the CATEGORYSUBSUBS and so on. At the end the product names from the selected CATEGORYSUBSUBSUBS will be displayed.
Iโm proposing this method, assuming that your PRODUCTS table contain all the ref columns regarding the CATEGORY, CATEGORYSUBS, CATEGORYSUBSUBS and CATEGORYSUBSUBSUBS.
Thanks Iโll give this a go!! Have a great day! :-)))
Youโre welcome. Please report us back should you require further help.
I have built out an app with only a single level of subcategory. But I donโt have an example that I can share.
3 Tables: Items, Categories, Subcategories
Items columns: Item Name (key), Item Category (ref), Item Subcategories (EnumList of Ref)
Categories columns: Category Name (key)
Subcategories columns: Subcategory Name (key), Category Name (ref and belongs to)
Items can must contain 1 Category
Items can have multiple Subcategories (but they donโt have to be related to the Category)
Each Category can have multiple Subcategories
Starting View: Categories (card) using LINKTOFILTEREDVIEW() to go to Subcategories (card) showing just the subcategories related to the category selected. This view then LINKTOFILTEREDVIEW() to Items (card) where the selected Subcategory is in Item Subcategories. Which then goes to the Item Detail view.
This is my most bare-bones basic explanation of how I have mine setup.
Bahbus I tried to follow your instructions - I made a quick video (2 mins) showing what Iโve achieved lol.
How do you change the โItemโ tableโs column โItem Subcategoriesโ to be"EnumList of Ref"? (see 1m 08 in video where I get stuck)
Could you please explain what you meant by this:
Starting View: Categories (card) using LINKTOFILTEREDVIEW() to go to Subcategories (card) showing just the subcategories related to the category selected. This view then LINKTOFILTEREDVIEW() to Items (card) where the selected Subcategory is in Item Subcategories. Which then goes to the Item Detail view.
I created a new view, called it Categories (it actually wouldnโt let me, cause i screwed one up previously and deleted it, and so it forced me to use Categories 2 for some reason), and change it to CARD. Then I looked up all the help I could find on โLINKTOFILTEREDVIEW()โ to no avail. :-)))
Column Type: EnumList - > Base Type: Ref. Do a Save & Verify. Then open the columns settings again so you can ensure the ref is being pointed to the right table.
Use have to create actions to use LINKTOFILTEREDVIEW() and put them on the cards. Something like:
LINKTOFILTEREDVIEW("Subcategories", [_THISROW].[Item Category]=[Item Category])
This one would be to go from Categories to Subcategories.
Thanks again Bahbus for your help. I have learned all about LINKTOFILTEREDVIEW() etc etc now and that works, although have discovered it doesnโt work with Dashboard views. Argh. So I canโt, for example, so a list of subcategories at the top of a page and then a list of the items in the overall category below it (ie. if a user clicks on the ELECTRONICS category, Iโd like it to show everything within it - but also give links at the top to subcategories, like โiphone cablesโ or whatever).
True, it doesnโt work with dashboards. I actually built it this way, because while I also wanted to use dashboard to achieve something similar to what you are also describing, there is no way to pull it off with a UI that also looks good. Itโs why I used Card views since they look good on a tablet (or webpage).
Thanks Bahbus - yeah itโs all very odd the way its made. So many limitations and dead ends. Iโm happy to code - even though the โno codingโ thing is everywhere for this framework lol - but it seems that thereโs no way to avoid certain issues like this one.
Iโm at a loss really - I donโt know how to build an app with โlevelsโ of categories. Seems like AppSheet is only built to have categories, in essence, and never to have subcategories - unless youโre willing to use Cards and just display the list of subcategory items, and go no further. ๐
Well, I mean, you can extrapolate this method to go much deeper. The reason dashboards donโt really work for this it because each set of categories are stored in separate tables with separate views. And we canโt dynamically add/remove views from the Dashboard.
In your example, Planents -> Countries -> Cities -> Streets, can still follow my example. You just need more tables. Streets has to ref the City. The City has to ref the Country. The Country has to ref the Planet. And explicitly, in this example, each tableโs ref would also belong to. If the city is destroyed (deleted), the streets in it would be too.
I know this is old. What action did you do to go from the subcategories to the item details?
It's 2024 and I need to replicate something similar with categorizing and subcategorizing items for on-the-ground management. Can anyone update this thread or redirect me? Or this workaround from 2020 is still the only solution around?
User | Count |
---|---|
18 | |
11 | |
11 | |
8 | |
4 |