I have a doubt,
when encoding a value test123 using the SET feature it gets standard json characters:
[
{
"data": "test123"
}
]
base64 result:
W3siZGF0YSI6InRlc3QxMjMifV0=
decode:
[{"data": "test123"}]
how do I remove everything and leave only the test123 value without quotes?
I need this to use an application that accepts only the value without any character like: [, {, ",: etc
code workflow:
{
"nodes": [
{
"parameters": {
"values": {
"string": [
{
"name": "data",
"value": "=test123"
}
]
},
"options": {
"dotNotation": false
}
},
"name": "Set1",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [
650,
250
]
},
{
"parameters": {
"functionCode": "const data = []\n\nfor (const item of items) {\n data.push(item.json)\n}\n\nconst dataBase64 = Buffer.from(JSON.stringify(data)).toString('base64');\n\nreturn [\n {\n json: {\n dataBase64\n }\n }\n]\n\n"
},
"name": "Function",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
840,
250
],
"notesInFlow": true,
"notes": "Base64 encoding"
}
],
"connections": {
"Set1": {
"main": [
[
{
"node": "Function",
"type": "main",
"index": 0
}
]
]
}
}
}