Binary to JSON problem

Describe the problem/error/question

I try to convert some binary data in a json to readable data encoding in utf-8 in a new field.

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

{
“meta”: {
“instanceId”: “3c306c4580d5053e06c89fde170880165a84bf6f23a8f85375e30a1b08e929f7”
},
“nodes”: [
{
“parameters”: {
“setAllData”: false,
“sourceKey”: “={{ $json.xml }}”,
“options”: {
“encoding”: “utf8”,
“keepSource”: true
}
},
“id”: “e93db011-a789-4fbb-8106-9e0564f3088a”,
“name”: “Get junit file”,
“type”: “n8n-nodes-base.moveBinaryData”,
“typeVersion”: 1,
“position”: [
420,
820
],
“alwaysOutputData”: true
}
],
“connections”: {}
}

Share the output returned by the last node

I expect to have some data in the output of my node but I don’t understand why there is nothing.
Thank you for your help.

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hi @Jerome_Blache I’ve created this topic about this few months ago.
Maybe can help you?

1 Like

Hi @Jerome_Blache, welcome to the community!

I am sorry you’re having trouble. In addition to what @Gabriele_Bracciali has shared it’d be great if you could share some example data you’re working with. If it’s a base64-encoded file you currently have (and you don’t want to write custom code) you could consider simply using two Move Binary Data nodes to convert this into a human readable string:

The first one would create a binary file based on what appears to be base64 data, the second one would read it as a string.

Thank you for your answer.

Thank you, it’s working now. I was able to retrieve my XML data using this method. I wasn’t aware that my file was base64-encoded.

This was my first time posting a question in this community, and I’m pleasantly surprised by how quickly people responded. n8n is a fantastic tool, and I hope you’ll continue to provide support to users like me in the future.

4 Likes

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