Insert Data from webhook to MySQL-DB

Hello, I would like to store the data of a contact form on my website via webhook on another mySQL server. I have built a test case

The webhook is called and the data is submitted as JSON.
How can I now store the concrete values (example: first name, last name) in the respective columns?

Attached is an example:


mysql2

I want to store in the test.person the values: max (vorname), mustermann (nachname)

Thank you in advance.

Hi @Azathoth, welcome to the community :tada:

You’re probably looking for the Set node here. This allows you to transform your items as needed.

For example, if the table columns in your person table would be called vorname and nachname, but the respective values come through like body["field[vorname][value]"] in your webhook, the workflow could look like so:

Note that the MySQL node wouldn’t require any expression in the “Columns” field but simply a comma-separated list of columns you’d like to insert data to:

Afterwards you should have data in your table looking like so:

image

Hope this helps! Let me know if you have any questions on this.

1 Like

I’m falling off my chair!! Now that was really easy! Thanks for the super help!

1 Like

Glad to hear this helped, thanks so much for confirming!

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