
Announcements
I send it a JSON table to my flow when I call it from a PowerApps app. This flow should create a report on a excel file and for it I'm using the using the "Add a row into a table" from excel connector.
The problem happens when it tries to add a JSON item that does not exist in the cell, but not all of them its obligatory. How can I handle those itens? so it can skip it or add a null?
The error:
Thats my flow
the marked itens it not obligatory [SLT_SERVICELINE, SLT_COSTCENTER, COMENTARIO, CONCLUSAO_DT ]
Parse JSON schema:
{
"type": "array",
"items": {
"type": "object",
"properties": {
"ATV_ATIVIDADE": {
"type": "string"
},
"ATV_CATEGORIA": {
"type": "string"
},
"ATV_CODIGO": {
"type": "integer"
},
"ATV_COMPLEXIDADE": {
"type": "string"
},
"CODIGO": {
"type": "integer"
},
"COMENTARIO": {
"type": "string"
},
"DURACAO": {
"type": "integer"
},
"ENGAGEMENT_CD": {
"type": "string"
},
"ENTRADA_DT": {
"type": "string"
},
"INICIO_DT": {
"type": "string"
},
"INICIO_DT_INT": {
"type": "integer"
},
"PJM_EMAIL": {
"type": "string"
},
"PJM_ESCRITORIO": {
"type": "string"
},
"PJM_GPN": {
"type": "string"
},
"PJM_NOME": {
"type": "string"
},
"QUANTIDADE": {
"type": "integer"
},
"SLT_COSTCENTER": {
"type": "string"
},
"SLT_EMAIL": {
"type": "string"
},
"SLT_ESCRITORIO": {
"type": "string"
},
"SLT_NOME": {
"type": "string"
},
"SLT_SERVICE_LINE": {
"type": "string"
},
"STT_CODIGO": {
"type": "integer"
},
"STT_COLOR": {
"type": "string"
},
"STT_STATUS": {
"type": "string"
},
"TICKET_ESS": {
"type": "integer"
},
"CONCLUSAO_DT": {
"type": "string"
}
},
"required": [
"CODIGO",
"DURACAO",
"ENGAGEMENT_CD",
"ENTRADA_DT",
"INICIO_DT",
"PJM_EMAIL",
"PJM_NOME",
"QUANTIDADE",
"SLT_EMAIL",
"SLT_NOME",
"STT_CODIGO",
"STT_STATUS",
"TICKET_ESS"
]
}
}
JSON Object EG:
{
"body": [
{
"ATV_ATIVIDADE": "Assinatura ",
"ATV_CATEGORIA": "Documentos",
"ATV_CODIGO": 123,
"ATV_COMPLEXIDADE": "baixa",
"CODIGO": 7756,
"COMENTARIO": "Atualização de relatório no sharepoint ",
"CONCLUSAO_DT": "07/03/2024 ",
"DURACAO": 16,
"ENGAGEMENT_CD": "E20202020",
"ENTRADA_DT": "07/03/2024 ",
"ENTRADA_DT_INT": 20240307,
"INICIO_DT": "07/03/2024 ",
"INICIO_DT_INT": 20240307,
"PJM_EMAIL": "Contoso.worker@cont.com",
"PJM_ESCRITORIO": "Contoso city",
"PJM_GPN": "AB99999999",
"PJM_NOME": "Contoso Worker Name",
"QUANTIDADE": 1,
"SLT_EMAIL": "Contoso.requester@cont.com",
"SLT_ESCRITORIO": "Contoso BR",
"SLT_NOME": "Contoso Requester Name",
"STT_CODIGO": 172,
"STT_COLOR": "#36B04B",
"STT_STATUS": "concluído",
"TICKET_ESS": 4484308
},
{
"ATV_ATIVIDADE": "Assinatura ",
"ATV_CATEGORIA": "Documentos",
"ATV_CODIGO": 124,
"ATV_COMPLEXIDADE": "baixa",
"CODIGO": 7860,
"COMENTARIO": "A bb cc ddd ee",
"CONCLUSAO_DT": "01/01/2024 ",
"DURACAO": 10,
"ENGAGEMENT_CD": "E10101010",
"ENTRADA_DT": "01/02/2024 ",
"ENTRADA_DT_INT": 20240101,
"INICIO_DT": "01/03/2024 ",
"INICIO_DT_INT": 20240101,
"PJM_EMAIL": "Contoso.worker@cont.com",
"PJM_ESCRITORIO": "City name",
"PJM_GPN": "AB00000000",
"PJM_NOME": "Contoso Worker Name",
"QUANTIDADE": 1,
"SLT_COSTCENTER": "BR Contoso 111",
"SLT_EMAIL": "Contoso.requester@cont.com",
"SLT_ESCRITORIO": "Contoso BR",
"SLT_NOME": "Contoso Requester Name",
"SLT_SERVICE_LINE": "ABC BBB CCC",
"STT_CODIGO": 172,
"STT_COLOR": "#36B04B",
"STT_STATUS": "concluído",
"TICKET_ESS": 4484538
}
]
}
You can use filter array to filter out the rows you don’t want to add or put a question mark between „items(‘apply_to_each’)” and the column. So for example:
items(‘apply_to_each’)?[‘SLT_SERVICE_LINE’]