How to save json raw value from another node into MySQL

I need to save a webhook node output body raw value in json format, as plain text into a database using MySQL node.

How can I convert the json raw value into a string, or any format that allows me to store the json as plain text in my database, using the Mysql node with insert operation?

Currently I am getting an error when the workflow reaches the Mysql node, because it doesn’t interpret the json as a plain string.

Example:

Thanks!

={{$node["Webhook"].json["body"].toString()}}

maybe?

1 Like

I get “[object Object]” as a result. Doesn’t work :frowning:

ok so its an array, you’ll need to potentially split it into items before making a string, hard to tell without the actual data

You could give {{ JSON.stringify($json["body"]) }} a shot (MDN), but it’d be helpful if you could share the JSON output from your Webhook node as @RedPacketSec suggested (anything confidential can of course be redacted).

1 Like

Solved!

Using {{JSON.stringify($node["Webhook"].json["body"])}} the JSON output now is correctly saved as plain text in MySQL.

Thank you very much @MutedJam and @RedPacketSec for your kind help :pray::raised_hands:

1 Like

Glad to hear, thanks so much for confirming :smiling_face:

1 Like