Aug 31, 2022 07:32 PM
Hi Everyone.
I 'm having trouble with an Automation (Scheduled Time, Find Records, Create Records) that will find all the records in a group (e.g. Group is “Week 36”), copy those records and create them into the next week’s Group. This in theory is simple and I can get it to almost work. It can find all the records I want it to.
But…
When it creates the records into the next week group it adds them all to a single record. Even if that linked record field is set to off for “allow linking to multiple records”.
I just need it to add a distinct record for each copied record in that new week, not jam them all into one record.
Aug 31, 2022 09:12 PM
Hi Stephen, unfortunately that’s…working as intended. We can’t create multiple records via an automation easily I’m afraid
If you’re on a Pro plan, you can accomplish this via a script, and if you’re on a free plan you can accomplish this via some weird workarounds
Here’s a base with the weird workaround
This involves an automation that will search for records with the type Group 1
, and then update a record with the result (a comma separated list) in another table’s record. Another automation will then paste a formatted version of the result into a linked field to the table you actually want to create records in, forcing a record to be created per comma separated value
And here’s a base with the script
This one’s pretty straight forward, Find Record
action into a Run a Script
action that just creates the records as needed
We can modify both of the above to create records with additional data as well
You could also use a third party service to help you with this like Make or Zapier or something, and if it’s a weekly thing the free tiers of those apps would work fine for you and probably be less of a headache than either of the above solutions honestly
Lemme know if you’ve got any questions, and if you want someone to just handle it for you can hire me to do it too!
Mar 09, 2023 05:35 AM
@TheTimeSavingCo I'm just getting started with scripting. Thank you so much for sharing your template base!! It was a great learning experience for me with a straightforward script that I was able to use to get the name/status fields duplicated into a new table as desired. What would be the process to add additional fields from the template table to the new table? For example: I want to add the data from the task order and task notes fields from the template to the newly created records. My first thought was to add a new variable but not sure where in the script to establish the variable name. Thanks in advance for tips!
Mar 10, 2023 07:06 AM
Hi Brandi, I'm glad it was helpful!
You'd just need to update the following line with the new variable name:
`let {foundRecordNames} = input.config()`
So something like:
`let {foundRecordNames, newVariable} = input.config()`
You'd probably need to change the way the looping works to grab data from both of the variables though
If you're looking to get this done quickly, I would recommend checking out the new repeating group functionality that will do what you need much faster
If you're just interested in learning more JavaScript for this let me know though and I can come up with an example of said different loop
Mar 11, 2023 05:15 AM
Thank you!! Yes I did end up using the looping actions instead of the script! When I tried to add the additional variables into the initial variable I kept receiving errors that the fields couldn’t receive the data. As far as I could tell the data structure was not different, in fact I changed them to single line text just to be sure. I think the special characters in my template records may have thrown the error but not sure. Thankfully the looping works and we don’t have to dig deeper here!! Thanks again for your quick response!!