Binary content to text (not move to json)

Hi,

I have a question i am trying to solve. I currently fetch JSON from a PIM system and that JSON contains correct JSON with escaped " (quotes etc). I want to store this complete JSON in Mysql so i can process it incremental.

Now the issue i have is that when running this trough the normal flow the quotes etc are not escaped anymore (i think because n8n just handles this correctly. But when storing that in mysql i lose the escaped chars and therefor cannot import it again.

Now, i thought i found a solution, when fetching the JSON as binairy i get a text string that still has the escaped chars and is ready to be stored in mysql. But now i cannot fetch/read the content in the binary file into a mysql query.

Any ideas on how to fix this?

Mysql Query with some data examples:

Binary content:

Ok found the solution in the community :slight_smile:


const binaryData = getBinaryData();

var data = Buffer.from(binaryData.data.data, 'base64').toString();
console.log(data);

item.ergonodeJson = data;
return item;

2 Likes