Mar 22, 2023 05:04 AM - edited Mar 22, 2023 05:06 AM
My goal is to create a single automation, that checks multiple separate fields and if they contain values, process separate actions.
For example, if a new record is created and there are values in the field weight, then update the weight field of the linked record. If a new record is created and there are values in the location field, then update the location field of the linked record.
Now the statements follow an IF -> ELIF (Otherwise if) logic, therefore if a new record is created and both fields (Weight and location) are not empty, only the first condition is fulfilled and the automation stops. In this case the weight would be updated (matching the first IF condition), but the location would not (because the first condition was fulfilled).
My workaround for this has been creating first a field that checks
IF weight AND location have values, update both,
ELIF weight has values, update weight
ELIF location has values, update location
However this does not scale very well if I want to check many fields. I would have to create a conditional statement for every possible combination. I also don't want to create separate automations for every single field - it would be neater in my opinion to have them all in one automation which would be possible if I was able to use IF -> THEN -> IF -> THEN type of logic.
The reason I want to check each field separately is that I don't want to overwrite fields that have not been updated. If the user has not made a change in weight, I don't want to overwrite the weight field of the linked record with null. This is why I need a conditional action.
Mar 22, 2023 07:09 AM
This isn’t currently possible with Airtable native conditions. You could do it with a custom script or a third party automation service.
Apr 21, 2023 03:09 AM
+1
May 03, 2024 03:54 AM
Yeah, I am facing the same issue here. It is a real problem, especially given that Airtable limit the amount of automations one can have per base...
May 27, 2024 07:39 AM
This is a severe limitation for my workflow as well. +1 this would be a wonderful addition to airtable.
May 27, 2024 09:27 AM
I found a way to work around this, but it's not easy and required a lot of fidling around with Copilot.
You can create scripts that run on a trigger that best suits your needs.
Go into Copilot AI, and ask it to write an airtable automation script that does what you need with all of your listed IFs. Remember to set the variables "recordId" in the left part of the script area and set the value to the recordId that comes from your main trigger.
This enabled me to go waaaay further than by using only what was available through the pre-set conditions that airtable offer.
Hope this helps 🙂
May 28, 2024 11:11 AM
Hi @EaZyGreen, do you mind sharing the link of the Copilot AI you used for this? and some more details about your prompts?
May 28, 2024 11:32 AM - edited May 28, 2024 11:32 AM
Hey,
It's just the Microsoft copilot chat: https://copilot.microsoft.com/.
All you have to do is literally ask it to create your script based on your needs and test it out in your automation.
Helpful tip: ask Copilot to add error checks in the script so you can feed it back with accurate error returns to correct the script if it's not working properly.