{
"body": [
{
"Nome do Utente": "teste56",
"Data da Venda": "2024-02-01",
"Nº Receita": "",
"Valor": "56,00",
"Observações": "sdasdddddddds",
"Assistente Social": "Joao "
},
{
"Nome do Utente": "teste67",
"Data da Venda": "2024-02-01",
"Nº Receita": "",
"Valor": "245,00",
"Observações": "Foi ali e voltou",
"Assistente Social": "teste67"
},
{
"Nome do Utente": "SSS",
"Data da Venda": "2024-02-01",
"Nº Receita": "",
"Valor": "150,00",
"Observações": "",
"Assistente Social": "Ricardo"
}
]
}
I am looking to enhance this array by dynamically inserting an additional column named "ID" for each record. The "ID" values should start from 1 and increment sequentially up for the subsequent records. The desired outcome is to have each item in the array uniquely identified by an incremental ID, as shown in the example below:
{
"body": [
{
"ID":1
"Nome do Utente": "teste56",
"Data da Venda": "2024-02-01",
"Nº Receita": "",
"Valor": "56,00",
"Observações": "sdasdddddddds",
"Assistente Social": "Joao "
},
{
"ID":2
"Nome do Utente": "teste67",
"Data da Venda": "2024-02-01",
"Nº Receita": "",
"Valor": "245,00",
"Observações": "Foi ali e voltou",
"Assistente Social": "teste67"
},
{
"ID":3
"Nome do Utente": "SSS",
"Data da Venda": "2024-02-01",
"Nº Receita": "",
"Valor": "150,00",
"Observações": "",
"Assistente Social": "Ricardo"
I envision utilizing a variable within a loop to achieve this, iterating over the number of items in my SharePoint list from which the original array is derived. However, I am uncertain about the most efficient way to merge these components successfully.
Could anyone provide guidance or share insights on how best to implement this functionality? Any suggestions or examples of similar implementations would be greatly appreciated.
Thank you in advance for your time and assistance.
Best regards,