I have inventory that is permanent and gets checked in and out. I have created a form that includes the status change, the inventory ID, and the name of the person who checked it out. We often check out 10+ items at one time, making them all part of 1 transaction.
The form form has a multiple select option for choosing every item they are checking out. The form data goes to a transactions table that is linked to a parent table that shows UTD inventory of all of our items at any given time.
Essentially, the process would be:
form submission â record created in transaction table â update status of selected items in the parent table
Here is the current automation Iâve been trying to work with, where it will run successfully:
Hey Wendy, looks like the automationâs breaking as itâs trying to update two records at once.
With the way Iâm guessing your base is set up, youâre going to need to use a script for this. If youâre not comfortable maintaining a script, we might want to consider rearranging the table / changing up the workflows a bit
If you could share a couple of screenshots of the relevant fields and tables of your base, or better yet, a read only duplicate of your base with sensitive data removed, that would be extremely helpful for anyone trying to provide advice
I also did create an automation that works, however even with ATâs increase in automations to 50, I may still end up with over 50 items in the future, so this may be a band-aid fix and will have to go back and be reconfigured as our inventory grows:
The updated record field input is just the record ID on the parent table.
I would have to create this automation per inventory item, which will max out at 50 automations, making in unsustainable long-term.
Iâm comfortable with use/editing of scripts, but I need the jumpstart + a little explanation.
How do you delay the automation run for few secs? Iâve always had this issue where the automation doesnât run properly due to certain column has not been populated.
Hey Hendrik, to do this I usually have another formula field that checks if NOW() is later than the created time of the record + 5 minutes or something. This is for situations where any of the fields involved might require multiple updates (For example, when adding line items to an invoice)
In a situation where none of the fields involved require multiple updates, I use the âWhen record matches conditionsâ, and make it only trigger when all of the fields the automation needs are filled
Is this because you are in a free workspace, or a different reason? If you are in a free workspace, you can only run button scripts, not automation scripts. Also, in order to update multiple records in an automation without scripting, you typically need to run the automation once per record, and you may not have enough automation runs in a free workspace.
@kuovonne I have an enterprise account, but our AT admin has disabled company use of non-AT apps & I had to get special permissions to use the script function.
I have an example of a script that introduces a pause in an automation in my set of Automation Helpers in my Gumroad store.
Keep in mind that this introduces a pause, but does not include a fresh read of the values in triggering record. You may need to do a fresh read of the record (either in a script or using a âfind recordsâ action) in order to get values that have changed after the automation was triggered.
Using NOW() does work, but it has some drawbacks.
NOW() only updates at best every few minutes, and at worst not for a few hours (if the base is closed).
Thanks for the clarification. Usually people who can access scripts but not apps are on free plans. Glad you got special permission to use scripts! Scripts are fun and very powerful.
Hey Wendy, hm, could I confirm that the single select option youâre trying to update to already exists in the âStatusâ field in Traps?
I usually see the error message you described when the option field Iâm updating doesnât already have the option Iâm trying to update to.
For example, if youâre updating the Status field to âIn the Fieldâ, but your Status field does not have the option, or has the option âIn the fieldâ (lowercase F), that might be causing this error
Oh man, thanks for this. Iâm going to need to start assuming the automations end up running a couple of hours later and see whether the use cases still fit, and also will need to start considering how many of these exist in the base
The script expects the options in the Transactions table to be of the format:
Checked in
Corresponding line: case "Checked in":
Checked out
Corresponding line: case "Checked out":
However, the options in the Transactions table are currently in the format:
Checked In
Checked Out
Note âinâ vs âInâ and âoutâ vs âOutâ
So we should try either updating the script or updating the options in the Transactions table, and then running the script again
The script also expects an Error option in the Status field of the Traps table. I included this (and still recommend it) as, in a situation where we changed or added options to the Status field of the Transactions table, the script would then use said Error option, which would alert us to the fact that something was not working as intended.
And so to fix this, we should add an Error option to the Status field of the Traps table