Dec 16, 2021 08:21 AM
I would like to see added a new condition that would allow an automation to stop at a certain point if conditions are met. Currently, I feel like I need to create a script to do that. Unless there is another method that I don’t see?
Dec 16, 2021 11:18 PM
Hi,
it depends on your previous steps and which part of their output you want to use if script should continue. Usually it’s possible by breaking automation into two parts and additional field (with checkbox, for example). First part “marks” record to change, second - do something with marked. If nothing marked, then second won’t run.
Dec 17, 2021 09:24 AM
I agree with this suggestion. Currently, I have a weekly recap pushing to Slack, but even if it is empty, it still pushes. Can’t think a work-around at this time, aside from script, which I’m not as versed in.
Dec 17, 2021 09:51 AM
It would actually be even more valuable if we could add CONDITIONS in any step.
If no conditions are setup, then it would simply always execute (and this would be default).
On the other hand, if we needed conditional step to be taken, it would simply translate to something like this:
1- Trigger: Checkbox is checked on table A
2- Step: Find matching records in table B
3- Step: If records found’s length = 0 then Create Record in table B
Personnaly, i’m fluent in Javascript, so I don’t really mind doing it in script, but it’s more time consuming than simply adding steps.
Dec 17, 2021 05:28 PM
Sorry, i don’t know what is recap.
Dec 17, 2021 05:34 PM
I use 2 approaches:
Sometimes the task needs a bit more that just no-code automation.
usual script is: take data, process, write.
in automation, you can define input/output with gui, and use simple pieces for processing.
e.g. take some record (single ID) from “find record” result (array of IDs)
this ID can be used in next step
In your case, you can pass lenght directly
Second, I started learning JS some months ago and I had troubles - to understand and remember all those “arrays of objects of arrays” and wasted much time on update/create at the script end.
So i prepared some templates like this
const table=base.getTable('test1');const fl='Calculation';
const upd=await table.selectRecordsAsync({fields:[fl]}).
then(q=>q.records.map(r=>({'id':r.id,'fields':{[fl]:''}})))
while(upd.length) await table.updateRecordsAsync(upd.splice(0,50))
Dec 17, 2021 07:04 PM
Yesm that part I understand. My suggestion aimed at a solution (suggestion actually because it doesn’t currently exists) that doesn’t involve scripting. Conditions is a rather common programming part of code and it could be easy to not have to rely on code to do so. (I’m thinking about those who don’t know javascript at all)