Can We Trigger Automation on New Row Added in a Table using another automation?

I add rows to a table using an automation. Is there a way to trigger another automation to detect the added rows ?
I used row change but the automation is not triggered when the new row is added to the table.

Hello @Zainab_Fitian .
The usual trick for the automation to catch the new row is to have a dedicated text column with a default value of <whatever you want> and configure the automation to watch for changes on this column. Not sure if it works when the row has been added via an automation too though…

If it doesn’t, maybe there is a way for your use case to write the actions of your second automation in the first automation ? Immediately after the creation ?

Thank you for your response. I tried this trick but it doesn’t work.
I wanted to write the actions in the first automation but I keep getting errors.

I have a table “publications”, in which I apply the first automation. The last step of this automation (step 8) creates a new row in the table “AllEvents” using the information from the JSON object that I have in the column “informations”

What I want to do next is to check if in the finale table “Events” there’s a row with the same “Name” and “Company Name” as new row in “AllEvents”, if yes; I want to modify the column “source” in the table “Events”, if no; I want to add this row from table “AllEvents” to the table “Event”

This is the formula that I wrote but it keeps throwing configuration error :

ForEach(thisRow.[Step 8 Result], WithName(CurrentValue, element , If(and(Name.Contains(element.Name), Company.Contains(element.Company) ), ModifyRows(Event.Filter( And(element.Name=CurrentValue.Name, currentvalue.Company=element.Company)),Event.Source, Event.Source+", "+element.Url) , AddRow(Event, Name, element.Name, Company, element.Company, [Function Type], element.[Function Type], Event, element.Event, Date, element.Date, Gender, element.Gender, Age, element.Age, Nationality, element.Nationality, Event.Source, element.Url ) ) ) )

Not sure with the formatting, but it seems your if statement doesn’t check values from the Events table but only the newly inserted rows.

You might need something like If(Events.Filter(Name=element.Name && Company = element.Company).isNotBlank()), ModifyRow..., AddRow...).

If you can provide a minimal copy of the document I can look into it later in the day or tomorrow if you want.

Now that I’ve seen your doc, I suggest another approach:

That is to avoid copying info between your AllEvents and Events table. AllEvents should be the single source of truth, Events is just another way to display the data. Each row has a name and company and a relation to events matching these two criteria. I’ve included a button as an example on how to regen such a table that you could call at the end of your main automation. But you could also directly use grouping functionality on AllEvents table if it’s just for display purposes :

Also take care, several columns are mixing different types of data, see the little red triangles in the upper left corner of cells.

This is just a quick and unoptimized answer, but I hope it can help you :slight_smile:

1 Like

Thank you so much @Martin_Portevin for your time and your help.
It is not directly answering my question but it is indeed helpful (:smile:

For the automation problem, maybe you could try to return a List() instead of using _Noop() in step 8. I guess it can make step 9 ForEach(thisRow.[Step 8 Result])... error as it won’t be able to ‘read’ from the empy value returned in step 9…
But I did not test it as when I try to copy your existing automation, Coda detects Step 8 Result as a text value instead of a list of rows from AllEvents table.

Another way would be to mark all newly added rows in AllEvents with a checkbox column value of true, then only process those in your step 9 and reset the checkbox column at the end of the step.

1 Like