Table of tables

I have an App to manage a big Agriculture Store.
The question is about Bills
I want to be able to make bills (many bills), store them, return to edit them…

I cant recapitulate by saying : Table of tables.
It a list of bills, every bill have his own table of rows and columns…

How can i do this

If you are thinking about creating a new table for every bill, then it’s going to be an absolute nightmare to maintain your app, because you will have to design screens every time q new bill is created.

You might want to rethink your data layout. If structured correctly, you should only need one table to hold multiple bills.

1 Like

The simple option:

  • Use two tables
  • The first table is your Bills table (think of this as holding all the parents)
  • The second table is your Bill Items table (think of this as holding all the children)
  • Each Bill can have one or more related Bill Items
  • The key here is to include a column in your Bill Items table to store the parent BillID value. This will allow you to create a relation between Bills and Bill Items

The not so simple option:

  • Use one table
  • Store all your Bill Items in a single column as a JSON structure

The second option is more efficient, but way more complex to setup and maintain. If you are new to Glide, I would strongly recommend the first option.

4 Likes

Thanks for fast replying…

I understand your first solution… BUT…
In the Table of “Bill Items”, each Bill is not only a row (in which case, i can related to), But a huge table of Rows (Selled Products in this bill) and Columns (Their Caractéristics as : Quantity, Price…)

Yes, that’s the idea. You can have as many Bill Items as you want. They all get stored in the same table and you relate them to the parent Bill via the BillID.

1 Like

I slept i know i can understand… I was in need of some reset
This morning i understood it

I m on it now, i will store everything in the same table, Give each item an ID of the Bill … and filter it for the display…

Thank youuuuuuu

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.