Describe the problem/error/question
Hi guys, sorry to bother you again, I’m trying to figure out how to merge a JSON output from one node into JSON as a nested array with a code node but I’m still getting empty property.
Does anyone have an idea of how to solve this? Also, this can be achieved with a merge node?
What is the error message (if any)?
Please share your workflow
Share the output returned by the last node
The expected output is this:
{
"dte": {
"datosGenerales": {
"tipo": "FACT",
"fechaHoraEmision": "2023-01-15T12:56:49.6090",
"codigoMoneda": "GTQ"
},
"emisor": {
"nitEmisor": "{{NIT Emisor}}",
"nombreEmisor": "nombreEmisor",
"codigoEstablecimiento": 1,
"nombreComercial": "nombreComercial",
"correoEmisor": "[email protected]",
"afiliacionIVA": "GEN",
"direccion": {
"direccion": "direccionEmisor",
"codigoPostal": 0,
"municipio": "municipioEmisor",
"departamento": "departamentoEmisor",
"pais": "GT"
}
},
"receptor": {
"idReceptor": "CF",
"nombreReceptor": "nombreReceptor",
"correoReceptor": "[email protected]",
"direccion": {
"direccion": "direccionReceptor",
"codigoPostal": 0,
"municipio": "municipioReceptor",
"departamento": "departamentoReceptor",
"pais": "GT"
}
},
"frases": [
{
"tipoFrase": 1,
"codigoEscenario": 1
}
],
"items": [
{
"bienOServicio": "B",
"cantidad": 1,
"unidadMedida": "UN",
"descripcion": "product demo",
"precioUnitario": 5000,
"precio": 5000,
"descuento": 0,
"total": 5000,
"impuestos": [
{
"nombreCorto": "IVA",
"codigoUnidadGravable": 1,
"montoGravable": 4464.2857142857,
"montoImpuesto": 535.7142857142
},
{
"bienOServicio": "B",
"cantidad": 1,
"unidadMedida": "UN",
"descripcion": "another product",
"precioUnitario": 5000,
"precio": 5000,
"descuento": 0,
"total": 5000,
"impuestos": [
{
"nombreCorto": "IVA",
"codigoUnidadGravable": 1,
"montoGravable": 4464.2857142857,
"montoImpuesto": 535.7142857142
}
]
}
]
}
Information on your n8n setup
- n8n version: 0.231.2
- Database (default: SQLite): PostgreSQL
- n8n EXECUTIONS_PROCESS setting (default: own, main): own
- Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
- Operating system: N/A