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: https://coda.io/d/_dIxcM8bFu2w/TEST-EVENTS_suH4C
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 : https://coda.io/d/_dIxcM8bFu2w/Using-groups_suq4R
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
Thank you so much @Martin_Portevin for your time and your help.
It is not directly answering my question but it is indeed helpful (
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.