I am new to red node and trying to set up a flow to insert messages in a MS SQL database.
I am having difficulty passing the values from the payload to the query. I can successfully insert into my table as long as a don't have any variables and the values are hard coded. Unfortunately when I pass a value to the query from the payload, my string is empty.
I am using a template node set to plain text to prepare the query for the sql node.
Inject Node:
Payload is set to JSON
{
"service": "myServiceName"
}
Template Node:
Insert into ActivityLog (ServiceName, MessageType, MessageText)
Values('{{msg.payload.service}}', 'sdfsd', 'sdfs');
Result in Debugging (empty string where my value should be):
Insert into ActivityLog (ServiceName, MessageType, MessageText) Values('', 'sdfsd', 'sdfs');
Thanks is advance for any guidance you can offer!