Hello everyone! I recently started to explore all the possibilities of n8n and like many newbies I encountered a problem, although perhaps I should spend more time.
I am creating a pipeline where I make a request to the API and get a list of dialogs, each dialog has its own unique ID. I want to write a new record to my Google spreadsheet (I use it as a database) if there is no such record yet.
My table has a Conversation ID field and I am trying to do Get Rows with the Conversation ID={ID} filter
And if such a record already exists, then go to the next action, and if it does not, then add a new record. But the problem is that the Node that does Get Rows returns data only if the rows are found, but does not return anything if there are no rows (and this is exactly what I need to make sure that such a row is still not in my table).
The main problem with using Append or Update is that if I want, for example, to insert values that did not exist yet (for example, Conversation ID and Status=PENDING) in order to subsequently process all records that have the PENDING status, then the Append or Update function will update all records, even those that have already been processed.
For example, I ran the process once and a record was added to my table
Conversation ID = 2
Status = Pending
Then I processed this record in another node, and the status changed to DONE
But when I run the process again, my node will apply Append or Update to this row and change the status from Done to Pending.
The main idea is to add only new records to the table and ignore those that have already been added if they still came from the API