Skip to main content
Question

Automation - Add dynamic amount of records to a table

  • December 5, 2018
  • 0 replies
  • 43 views

I'm looking to add records to a table via an automation based on a variable numeric field in the trigger table. So if the field is 1 I add one record to a table, if 2 then 2 and so on...
This topic has been closed for replies.

Low tech solution if you have a limited number of choices for the # of records to be added, say between 1 and 10 is to have 10 Automations and fire them based on checking that number.

It is also possible to write a looping Automation which will increment a counter and then trigger itself to run again as long as the counter is still less that the number to be added.

You can do up to 100 loops before Quick base will assume that you may have created and endless loop and stop the process.

  • Registered
  • December 6, 2018
Don't use Automations - just use a simple native formula (with some embedded JavaScirpt)! If you use 100 looping Automations QuickBase will run low on inventory and everyone will be effected.

Without loss of generality, I am going to assume you want to create N child records associated with a parent record you are viewing.


Here is the demo:



Create N Child Records ~ View Parent Record 
https://haversineconsulting.quickbase.com/db/bn8aam6y8?a=dr&rid=1

Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=td&rid=698

Notes:

(1) Feel free to create your own parent record and add your child records to it by viewing the parent record and clicking the button.

(2) You can customize the formula further by editing some of the hardcoded ids and apptoken, 

(3) No code pages was used in the creation of this demo.

(4) This is a great way to initialize child records representing a number of fixed assets such as seats in a class,