Repeatable Form / Form Submission to Multiple Tables

First off, sorry if this question is too complex and/or involved for this forum, but I am having trouble getting my app to function correctly from where I currently have made it. I figure the easiest way to explain is just summarize what I am looking to create here, and maybe someone will have some insight to help get me unstuck…

“Ideally” I would like the form to be laid out something like this:

I am trying to create a simple commission calculator app, with really only two pages required, where a user inputs his or her sale and some corresponding info into a form and then view a statement of commission payments related to that user on dashboard page or something. The Record New Sale screen though is where it gets a little complicated, and even so I dont think it is “super complicated” to someone who has more experience with this than I do…“Ideally” I would like the form to be laid out something like this (which essentially would be in about three parts, sort of):

Screenshot 2022-06-23 185155

The SAVE button at the top would save all items within the form; the ADD LINE ITEM button would dynamically recreate/duplicate everything within that Line Item box and add it directly below it (in theory an infinite number of times, if one were so inclined); then within the Line Item box (or sub-form, if you will) there is a Split Commission section (effectivly a sub-sub form, of sorts) where someone could divide the commission between one or many other employees for that specific Line Item.

My table structure (at least as I currently have it, but I am open to input/advice here if something different is recommended) includes 5 tables: Transaction, Line Items, Comm Splits, Items, and Users. “Transactions” table has a column for ticket number and for date for the fields as in the above form then a relationship to “Line Items” table allowins many Line Items to one Transaction row. “Line Items” table has columns also for the fields you see above - Item, Value, Date, Description plus a relationship to “Comm Split” table which also allows meny Comm Split rows to one Line Item row, and also a percentage column column which brings in the corresponding percentage from the Item table (which exists as an updatable list of values), based on the dropdown selction of Item within the Line Items secton. Then the “Comm Split” table has two columns, Employee and Percentage, where the percentage field is a number field and the employee is generated from a dropdown selection linked to the users table as a list of values.

I have used the CRM app template to try and somewhat recreate the functionality for this, at least to dynamically add on the field groups, but can not seem to get it to function correctly.

I feel like what I am trying to create is relatively straight forward - with the exception of dynamically adding a sub form (or sub-sub form) and with the table referencing where A references B and B references C, then generates a table that filters table A referenced rows in table C (through table B).

Any input they can provide here that might push me over the hurdle I am at now, it would be greatly appreciated!!

Hi @Michael_Jager

Yes, it sounds a little bit complicated, let’s split the whole project into small parts and then solve them one by one.

According to the UI part I can recommend you to consider using ReusableComponents and Repeaters

1 Like

@vladimir-upirov, thanks for the reply! I do have those included - I have one block around the whole “Line Items” section (which includes the commission part), and a second block around just the commission split section and have the repeater box checked. This, however, is where I am getting stuck. When I do this without any logic attached and preview the app, these sections are now hidden. I was able to follow through the logic within the CRM app like I mentioned and I tried to dissect which parts were relevant to what I am trying to do, and was able to preview the app with these sections now showing up not hidden, but nothing more - I could not get them to reproduce with the button click, now would the data within the fields save to the respective table(s) or anything.

If there was a document that went into a fair amount of detail about each individual repeater block, and/or maybe gave an example or use case of each (or most) of them, I feel like this info alone could be enough that I could work my way through it, but the only documentation I have found only includes some of the blocks, and the information that it does include it fairly vague and limited. Maybe I am not looking in the correct place?

here is the doc for Repeater Repeaters - Backendless UI Builder Developer Guide