diff --git a/tablero-cdc-sync-proyecto-a-sheet-webhook.json b/tablero-cdc-sync-proyecto-a-sheet-webhook.json index 49b2ddc..4c54637 100644 --- a/tablero-cdc-sync-proyecto-a-sheet-webhook.json +++ b/tablero-cdc-sync-proyecto-a-sheet-webhook.json @@ -1,5 +1,5 @@ { - "updatedAt": "2026-06-05T16:40:16.216Z", + "updatedAt": "2026-06-05T16:40:24.144Z", "createdAt": "2026-05-27T18:36:03.445Z", "id": "d39DtIUTQzduqX0v", "name": "Tablero CDC - Sync Proyecto a Sheet WEBHOOK", @@ -603,7 +603,7 @@ }, { "parameters": { - "jsCode": "// Loop over input items and add a new field called 'myNewField' to the JSON of each one\nfor (const item of $input.all()) {\n item.json.myNewField = 1;\n}\n\nreturn $input.all();" + "jsCode": "const projectId = $('Code - Preparar project_id').first().json.project_id;\n\nconst rows = $input.all();\n\nconst matches = [];\n\nfor (const item of rows) {\n const row = item.json;\n\n const rowProjectId =\n row['Project ID'] ||\n row['project_id'] ||\n row['PROJECT ID'] ||\n '';\n\n if (String(rowProjectId).trim() === String(projectId).trim()) {\n matches.push(row);\n }\n}\n\nif (matches.length === 0) {\n return [\n {\n json: {\n ok: true,\n action: 'delete',\n project_id: projectId,\n found: false,\n message: 'No se encontrĂ³ fila en Google Sheet para ese Project ID. Se considera eliminado.',\n },\n },\n ];\n}\n\nreturn matches.map((row) => ({\n json: {\n ok: true,\n action: 'delete',\n project_id: projectId,\n found: true,\n row_number: row.row_number || row.rowNumber || row.__rowNumber || row.rowIndex,\n row,\n },\n}));" }, "type": "n8n-nodes-base.code", "typeVersion": 2, @@ -735,9 +735,9 @@ "meta": { "templateCredsSetupCompleted": true }, - "versionId": "b1859da8-c763-4642-bfe4-c6f9d0931167", + "versionId": "46652e3e-de02-47d5-b092-a856e3b9eecb", "activeVersionId": "17638407-8c4f-4070-b040-a23f2750265e", - "versionCounter": 89, + "versionCounter": 90, "triggerCount": 1, "shared": [ {