In first row (first size), first two fields are mandatory to be filled up. Other sizes are optional. And there is a bulk size in bottom, if selected, only Unit is mandatory.
On form submit, I want to add these sizes as separate rows to another table (Add Row action). However, since some of these fields are optional, even on first size, I am not sure how do I add those details to add row actions.
Initially I did was, combine all sizes as single column, all units in single column etc, then split those sizes and units etc. and using single value I would add row, but then I realised what if Client has not filled up some of the non-mandatory fields. That will break logic.
There is master product table. Client will submit a form for new product with all relevant details. In this form, I am having these fields (screenshot attached above) which will write to Master Product table. However, upon submission, I want to configure an action where if Client has added sizes (Atleast one should be mentioned while submitting form), then each such size should go to another table named “Sizes” which will be linked Master Product table.
Please note that each size will have Qty, Unit, Item# and Weight in Lbs. Qty and Units are required field to add a size. Item# and Weight are optional fields.
Additionally there is separate fields for Bulk size as well which should also go to Size table (similar to other sizes).
Problem: I am looking at a scenario where
client has added two sizes but without Item# or Weight OR
Client has added One size with all fields filled up but may partially fill up second size
So I am just trying find a way to make none of the scenario breaks the logic of the App.
I hope I am explaining it correctly.
One thing I’ve done before was force something in the empty field, for example, a dash “-.” It ends up being comma-separated. Hacky, but it works
Looking at this picture + reading about optional sizes, my immediate thought was to use progressive disclosure. So you would start with just one size as you have it here, and then add a button that says “add another size.” Glide probably won’t be able to create fields like this on the same page, but there’s no reason why an overlay form won’t work…
Also, as I’m writing this, why not use a collection/table here instead of the form?
I already did this but, since its a screen form, it was not allowing me to use button more than once.
The form I am using is to submit the details of Product for the first time. So if I use overlay form for sizes (before the actual form is submitted), I won’t have product details in Size table and won’t be able to link product with sizes.
How would I link a product (which is not yet submitted to Database) to the sizes which I will add through Table/collection?
I have initially done this but client wanted to give an option to add Sizes at the time of this form submission. In any case, they are getting an option to add sizes in detail screen if they want to add any time afterwards.
I see you are struggling with this subject… and I will advise you to change your data structure… is never a good practice to add multiple rows for one record… also having separate tables for the same items… will always create problems for the data analytics and editing.
Add more columns… not more rows or tables. Most of the data structures need only two tables, Users and Data… then you just use filters to fish out what you need.
Thank you @Tamara_Didenko for all your help. This option looks better. I will try to implement this and see if that is viable option for App.
However, the only issue I feel is, since its on detailed screen, it may cost lot many updates because I have many fields to be filled up on the initial form.
But I like your innovative way of thinking. I will sure try this option. Thank you so much.