Help

Re: Auto Create X Number of Records

Solved
Jump to Solution
3052 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Jason_Burke1
6 - Interface Innovator
6 - Interface Innovator

Is it possible to get AirTable to generate X number of records in a table?

Example:

Table: Batch
Col: Date
Col: Batch Number
Col: # of Units Produced

Table: Units
Col: Batch Number
Col: Serial Number

I’d like to create a record in Batch table, and if I say 10 units were produced in that batch, then automatically 10 NEW records appear in Units table (all of them linked to their batch in the Batch table) and all of them assigned automatically a sequential number (starting number would be MAX of whatever serial number is already in tab from PREVIOUS batch).

I can’t even begin to wrap my head around this one.

So, the two main issues would be automatically creating X records based on the event of another table AND auto generation of serial numbers starting off at the last serious number of previous batch.

Is this impossible?

1 Solution

Accepted Solutions

That message popped up because your base is in a Free plan workspace, where access to the Scripting block ends in September. Bases in a Pro plan or higher workspace can use all blocks all the time.

That’s going to be a problem. Airtable cannot auto-export anything because it has no built-in automation features. Even if it did, it’s is a web-based service, and any output from a website to a file on your local machine requires user intervention, even if it’s only to specify where to save a file.

There are a couple of ways around this that come to mind. One would be to use the Page Designer block to design and print your labels directly from Airtable. Another would be to have the CSV file created as part of the Integromat scenario that does the record creation and linking mentioned previously. The file could be saved to Google Drive, Dropbox, or another service of your choice, where you can access it for printing. I don’t have experience making CSV files on the fly like this, though, so I can’t offer specific tips on how to pull it off. My recommendation would be to use the Scripting block to build the records, and the Page Designer block to print the labels.

I feel that scripting is probably going to be the easier of the two options. I suggest going through the various examples that the Scripting provides to see how the code is designed and to learn the kinds of things you can do. If you run into any problems, start a new thread in the #scripting-block category and we’ll be happy to help. If you’d rather hand over the scripting to someone else, message me and we’ll talk details.

See Solution in Thread

8 Replies 8

It’s not impossible. To do it natively inside of Airtable will require the Scripting block. You could add a button field onto your [Batch] table. Clicking that button would trigger a script that would make the new records in the [Units] table, assigning them the correct numbers and linking to their related batch record. To prevent a batch of units from being made twice, you could add a {Units Created} date field on the [Batch] table, which would be filled by the script once it’s done making and linking the units. If you accidentally click the button again, it would check the field first, and alert you if it finds a date. It’s not total hands-off automation, but it’s all within Airtable.

This could also be done using an integration service like Zapier or Integromat. It might be a little trickier to set up, and it would run on a set schedule (between 1 and 15 minutes, depending on your account level), but it could be completely hands-off if that’s what you prefer.

If you’d like help with either set up, let me know and I’ll be glad to assist!

Hi Justin,

Thanks for the reply! I’d be very interested in learning more. I would prefer the easier method to implement, only because I’m very new to all of this and can get lost easily.

To make this even more complicated, after the X records are created in the Units table, I’d like those newly created records to be auto exported into CSV file. Basically, not only am I creating a log of units that will have their own serial numbers (for use with barcode/QR code) but the export allows me to take those new units and dump that file into my label printer to easily print a batch of labels off of the new records.

Hopefully that made sense.

You mentioned this will use scripting. When I added a script block it mentioned users will have access to this until September of 2020. Does that mean this feature is being phased out?

That message popped up because your base is in a Free plan workspace, where access to the Scripting block ends in September. Bases in a Pro plan or higher workspace can use all blocks all the time.

That’s going to be a problem. Airtable cannot auto-export anything because it has no built-in automation features. Even if it did, it’s is a web-based service, and any output from a website to a file on your local machine requires user intervention, even if it’s only to specify where to save a file.

There are a couple of ways around this that come to mind. One would be to use the Page Designer block to design and print your labels directly from Airtable. Another would be to have the CSV file created as part of the Integromat scenario that does the record creation and linking mentioned previously. The file could be saved to Google Drive, Dropbox, or another service of your choice, where you can access it for printing. I don’t have experience making CSV files on the fly like this, though, so I can’t offer specific tips on how to pull it off. My recommendation would be to use the Scripting block to build the records, and the Page Designer block to print the labels.

I feel that scripting is probably going to be the easier of the two options. I suggest going through the various examples that the Scripting provides to see how the code is designed and to learn the kinds of things you can do. If you run into any problems, start a new thread in the #scripting-block category and we’ll be happy to help. If you’d rather hand over the scripting to someone else, message me and we’ll talk details.

Hi Justin,

Plan: Hmm, that’s odd. I am currently paying for the pro plan.

CSV: No problem. Manually exporting the CSV file is easy enough.

Scripting: I will take a stab at getting my feet wet with scripting. I won’t get too far, so you’ll be seeing my posts shortly in #scripting-block. Haha! Thank you for all your input, I appreciate it! :slightly_smiling_face:

Just as a reminder, plans are assigned at the workspace level. If the base where you add the Scripting block isn’t in a Pro plan workspace, then it can’t use Pro plan features. I’m not sure if that’s your issue here, but that’s what comes to mind based on our conversation so far. If that’s the case, you could always move the base into the Pro plan workspace at any time. There’s no penalty for moving bases between workspaces with different plans.

Buca
4 - Data Explorer
4 - Data Explorer

Hello Jason, I'm not sure if you managed to do what you needed. I'm just starting with Airtable and I'm looking for something similar to what you mentioned. I need to create records automatically. For example, if I have a service that generates fixed income for X months, I would like the system to automatically create "X" corresponding records based on the start date, end date, periodicity (monthly in this case), and the income amount that I input.

Do you think this is possible, and how can I create it to then upload it to Airtable? It would be of great help to me. Thank you very much."

Hi @Buca, we have built an app for this!: https://lomlabs.gumroad.com/l/zbkfxz

You can set the start date, end date, and intervals and it will create the records for you with Airtable Automations:
enddate.gif
Or you can just set the number of times you want the event to occur too!