Trouble with Basic mysql Statement

Hi
I have a very basic mysql query which executes fine when running in my database query software. It uses a device_id variable which is set in a previous node in the workflow, but you can see that n8n is pulling the value of “399” through successfully to complete the expression. However when this node runs, it errors with the attached error. I don’t understand as there’s nothing wrong with the statement itself.

The simple query is select * from messages where device_id = 399

Information on your n8n setup

Hi @mbuk :wave:

That query looks normal to me :thinking: Could you try something like {{$node["HTTP Request"].json["id"]}} instead and see if that works?

Hi there
I’ll give that a try. After troubleshooting, it seems to only want to work if I bring a connector all the way from the previous node to the mysql node (even though the node is named in the expression).

3 Likes

Glad you got that sorted, @mbuk !

1 Like

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