Boolean (false/true) in insert MySQL

I am getting JSON from an API with several Boolean values. I want to insert it into a MySQL Table.
However the True/False is not possible. I have to convert it to 1 or 0 before I can insert it.

In the MySQL Table the Column is a TINYINT.

What is the error message (if any)?

ERROR: Data too long for column ‘lactosevrij’ at row 1 (As String with “”)
ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘,“Recepten”)’ at line 2 (as is)

Please share the workflow

Information on your n8n setup

  • n8n version: 0.166.0
  • Database you’re using (default: SQLite): MySQL
  • Running n8n with the execution process [own(default), main]: own
  • Running n8n via [Docker, npm,, desktop app]:NPM

Hey @heestp, I am not sure I fully understand your question unfortunately.

Would you like to know how to convert a Boolean value into either 0 or 1? This could, for example be done with the ternary operator described here.

Here is an example workflow showing the idea. You can copy it straight into your n8n canvas:

Example Workflow

Problem is that I have to convert every Boolean value into a 1 or 0. The MySQL node won’t take the true/false in a insert or update query.

I made a lot of If and merges. Your solution really helps a lot but it keep feeling like a work around.