I am attempting to clean up this particular array of data:
[
{
"Cpf": null,
"Nascimento": null,
"Sexo": null,
"OnlyPerson": false,
"IsFinanc": false,
"Senha": null,
"ConfirmaSenha": null,
"Remover": false,
"TipoStr": null,
"FiltroStr": null,
"IdAgenciaLogarComo": 0,
"DontHashPass": false,
"IsPessoaSimples": false,
"IsVisitante": false,
"Permited": false,
"Id": 21980,
"Nome": "arrozfeijao",
"Ativo": true,
"Criacao": "2021-08-19T14:09:06.173",
"UltimaAlteracao": null,
"Email": "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="5a3b282835203c3f33303b351a3d373b333674393537">[email protected]</a>",
"IdAgencia": 1,
"IdEndereco": null,
"IdPermissao": 4,
"Observacoes": null,
"Endereco": {
"Id": 0,
"Cep": null,
"Logradouro": null,
"Numero": null,
"Complemento": null,
"Bairro": null,
"Estado": null,
"Cidade": null
},
"Parceiro": null,
"Contato": [],
"Permissao": {
"Id": 4,
"Descricao": "Cliente",
"Pessoa": []
},
"AlterarSenha": [],
"Rede": [],
"Provider": [],
"AlertaPreco": [],
"Pedido2": [],
"_PageNumber": 0,
"PageNumber": 0,
"PageSize": 0,
"OrderBy": null,
"OrderDesc": false
}
]
These are the details for a checkbox selected in a table -> view image description here I require a function that can clean the array every time I select an additional checkbox. I have attempted to use the push method to store all necessary information in a new variable, but it fails when selecting checkboxes with different information...
I need to export these details to CSV file, but I only require the following fields:
- "Cpf"
- "Nascimento"
- "Sexo"
- "Id"
- "Nome"
- "Ativo"
- "Criacao"
- "UltimaAlteracao"
- "Email"
- "Observacoes"
- "Endereco".
I understand that I need to use a for loop, but I'm unsure how to create this function :c