I was running into a problem where I wanted my users to be able to add multiple days off for employees by just selecting a range of dates. This meant that I had to create multiple records from one form. I was able to accomplish this by using three tables.
Table 1 (just updates) - is a single record form that gets updated, but no new records are added.
Table 2 (just updates)- has a bunch of formulas in it that look back at table 1 to figure out how many records to create. My action button updates a counter here, and this initiates a workflow. That workflow takes the data off of this sheet and updates the table where this record will ultimately live.
Table 3 (creates new records)- Due to the workflow initiated by the counter in Table 2, new records are created here.
I upgraded this by just adding a parent ID and a counter to table 1. Now when I hit my action button it increases the counter on table 1, creates a new parent ID, updates table 2 with records, then adds new child records to table 3 that now has a child record ID and parent record ID, I created table 4 that now holds the new parent record.
In summary, I have one form that a user can update with a range of dates. After they finish they hit a button, and then it creates a parent record and multiple children records.
I think this would be simple to just ask for a qty for the user also.
Hereโs the link to my app, have a peak under the hood
Child Records
This is an amazing solution. Thanks for posting it! I think you need to mark this app as a public sample, as Iโm not able to look under the hood or see the definitionโฆ
I think I made the definitions visible now. Please take a look, if that didnโt do it, do you have a link I can follow on how to make it public?
Thank for liking it, I thought it was a clever work around
Follow Lynnโs guide. Cheers
https://community.appsheet.com/t/making-an-app-public-in-your-portfolio/11942
Great thank you. Here is a link to my portfolio
https://www.appsheet.com/portfolio/1236495
If you need me to explain any of my work just let me know. As I stated, the magic is in the spreadsheets.
Hi @School_Bus
Do you have the App definition set to hidden? I cannot see under the hood.
Ok, itโs no longer hidden.
@School_Bus
Thanks , will check it out.
@Martin_Pace This was the one I was talking with you about
Hi,
I have a requirement that there is one parent table and 4 child tables. Before saving, I want to create 10 records in child table 1, 20 records in child table 2 per child table 1, 5 records in child table 3 per child table 1 and say 8 records in child table 4 per child table 1.
And then I want to give quick edit in the table created for child records. Since, it is very difficult for the users to do entries in child tables one by one clicking on new button.
Basically, the scenario is like as below.
Can this be achieved in AppSheet?
Thanks.
Yes, I believe so. I think itโs really just expanding what I did before, but now you are using multiple sheets to do it. If the number of child records are static it should be even easier to accomplish. I think the quick edit is also doable
But how to create blank records first and then allow for quick edit.
For your scenario if you use actions it will work but I donโt think it will be good idea to use actions if you have to add more rows each time. If you create 3 records an you might have to add 10+ rows each and sync time will be never ending.
You can try creating a bot instead of using actions. I personally prefer appsheet API on add row event.
this is a better way to do the child records than I created. I was coming back to link to that string.