MySQL Node: Insert operation when column names don't match

Hello -

I am running N8N

I am stuck in a scenario that seems simple: I am able to do a MySQL insert with the MySQL node when I have a simple mapping of 1:1 for column names in the Input to output in the MySQL Ouput table (IE: if my Input is ID, Name and my MySQL table has the columns ID, Name).

The scenario that I am stuck: what if my Input has a 3rd value that can be referenced with: {{ $json[“AP”][0] }} and it should map to my MySQL table with Autopilots?

What is the best approach? If I try to use the Expression table of the MySQL node it seems to think my column name is “{{ $json[“AP”][0] }}” which isn’t correct…

Any advice is appreciated!

Thank you

Hi @n8n_rookie :wave: If you don’t have a matching column, you’ll need to use a set node or rename keys here - you can find some more information on that here:

1 Like

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