Hello everyone! I’m having a problem while iterating through a JSON to search if a student has passed a test, and retrieving his informations to update his pontuation.
I have his info on a Google Sheets, who I import his basic informations (ID, name, email, etc), a boolean for each test he has passed (test_01, test_02, etc), and a pontuation interger, who has to be updated accordingly to which tests he had passed.
The big problem is, whenever I run the code to iterate over the students and see who passed and retrieve the data, it returns me all the students data, and it doesn’t actually calculates the pontuation.
Here’s my workflow
The output I get:
[
{
"ato0Concluido": [
[
[
{
"ID_cademi": 19637349,
"nome": "Isis Gonçalves Ferreira",
"email": "[email protected]",
"cpf": "484.699.668-98",
"celular": "11968398010",
"criado_em_cademi": "2024-09-24 22:13:39",
"prova_ato_0": true,
"prova_ato_1": true,
"prova_ato_2": true,
"prova_ato_3": false,
"prova_ato_4": false,
"prova_ato_5": false,
"prova_ato_6": false,
"prova_ato_7": false,
"curso_bonus": false,
"pontuacao": 0
},
{
"item": 0
}
]
],
[
[
{
"ID_cademi": 19637680,
"nome": "Maria Madalena Ferreira ",
"email": "[email protected]",
"cpf": "393.100.519-49",
"celular": "15997626988",
"criado_em_cademi": "2024-09-24 22:23:41",
"prova_ato_0": true,
"prova_ato_1": false,
"prova_ato_2": false,
"prova_ato_3": false,
"prova_ato_4": false,
"prova_ato_5": false,
"prova_ato_6": false,
"prova_ato_7": false,
"curso_bonus": false,
"pontuacao": 0
},
{
"item": 1
}
]
],
[
[
{
"ID_cademi": 19637356,
"nome": "Cinara Soares",
"email": "[email protected]",
"cpf": "148.931.228-51",
"celular": "11997444455",
"criado_em_cademi": "2024-09-24 22:13:39",
"prova_ato_0": false,
"prova_ato_1": false,
"prova_ato_2": false,
"prova_ato_3": false,
"prova_ato_4": false,
"prova_ato_5": false,
"prova_ato_6": false,
"prova_ato_7": false,
"curso_bonus": false,
"pontuacao": 0
},
{
"item": 2
}
]
],
[
[
{
"ID_cademi": 20331696,
"nome": "Isabella Fernanda Fonseca Cabrera",
"email": "[email protected]",
"cpf": "",
"celular": "5561991894556",
"criado_em_cademi": "2024-10-25T09:41:03.936-03:00",
"prova_ato_0": false,
"prova_ato_1": false,
"prova_ato_2": true,
"prova_ato_3": false,
"prova_ato_4": false,
"prova_ato_5": false,
"prova_ato_6": false,
"prova_ato_7": false,
"curso_bonus": false,
"pontuacao": 0
},
{
"item": 3
}
]
]
]
}
]
The output I want:
[
{
"ato0Concluido": [
[
[
{
"ID_cademi": 19637349,
"nome": "Isis Gonçalves Ferreira",
"email": "[email protected]",
"cpf": "484.699.668-98",
"celular": "11968398010",
"criado_em_cademi": "2024-09-24 22:13:39",
"prova_ato_0": true,
"prova_ato_1": true,
"prova_ato_2": true,
"prova_ato_3": false,
"prova_ato_4": false,
"prova_ato_5": false,
"prova_ato_6": false,
"prova_ato_7": false,
"curso_bonus": false,
"pontuacao": 110
},
{
"item": 0
}
]
],
[
[
{
"ID_cademi": 19637680,
"nome": "Maria Madalena Ferreira ",
"email": "[email protected]",
"cpf": "393.100.519-49",
"celular": "15997626988",
"criado_em_cademi": "2024-09-24 22:23:41",
"prova_ato_0": true,
"prova_ato_1": false,
"prova_ato_2": false,
"prova_ato_3": false,
"prova_ato_4": false,
"prova_ato_5": false,
"prova_ato_6": false,
"prova_ato_7": false,
"curso_bonus": false,
"pontuacao": 110
},
{
"item": 1
}
]
]
]
}
]
Has anyone been through this, or something similar? Can gimme any advices?
Sorry for any english mistakes, it’s not my first language.
Information on my n8n setup
- n8n version: 1.63.4
- Database: A Google Sheets
- Running n8n via: Docker on a desktop app.
- Operating system: Win11