Create a new row in my MYSQLTable when i add a new row to my GoogleSheet

Hi, im an intern in need :sweat_smile: i need to create a workflow where when added new data in the googlesheet it gets added to my table in my mysqldatabase. I got to add te first row, then when i added the second it says that the id is duplicated, because the first rows already existis in my table. How to add only the new ones and ignore existing data in the Sheet?

Hi @Fernanda_Silva,

the easiest solution here is probably to use the Google sheets trigger node to automatically execute the workflow when something changes in the spreadsheet.
Then, with the “Compare Datasets” node, you can compare the data from the spreadsheet with the MySQL database. It outputs all new items and all updated items in its own path.

Here’s a small workflow:

If you do not need to update rows, you can just remove the MySQL update node and set the “Trigger On” field in the google sheets trigger to “Row Added”

Hope that helps :slight_smile:

4 Likes

OMG THANK YOU! Thats exactly what i needed! <3 you’re awesome! :partying_face:

3 Likes

Hello. I have a question.
If I have 3 rows and change one of them in sheets, this row will show as “A only” but it is a update, not a now row. So, this schema will try to insert it in the MySQL instead of updating. How can I manage that?

if the Id , or uuid column, remains the same in this row youve changed it will count as an update not a new insert. :thinking:

If the id (in my example called uuid) changes, it gets treated as a new entry.
You can add a delete command on the “B only” path of the “Compare Dataset” node, to delete the old item.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.