Hi all,
I have a JSON (see below) which contains a series of form submissions. Each submission includes a formSubmissionId and a series of fields with their corresponding fieldReferenceId and fieldValue.
What I want to do is produce a new array listing all the records where the fieldReferenceId '18c837cd-1dae-4961-9164-3de23e9c954b' has a fieldValue of 'a1GJ7000000sZ9cMAE'.
In the example JSON below, there are two submitted records. I want to extract only the second one, because it has a fieldValue of 'a1GJ7000000sZ9cMAE' for the fieldReferenceId '18c837cd-1dae-4961-9164-3de23e9c954b'.
Due to the potential size of the data, I believe using a 'FilterArray' would be more efficient than nested 'Apply To Each' actions.
I really appreciate any help with this.
Thanks.
{
"statusCode": 200,
"headers": {
"Date": "XXXXXX",
"Content-Type": "XXXXXX",
"Content-Length": "XXXXXX"
},
"body": {
"data": [
{
"formId": 72684,
"formSubmissionId": 123456789,
"createdTimeStamp": "2024-05-16T08:26:29.913",
"modifiedTimeStamp": "2024-05-16T08:26:29.93",
"fields": [
{
"fieldReferenceId": "d9005789-8b54-4b24-ab44-16723ae7ddfc",
"fieldValue": "123, Apple Road"
},
{
"fieldReferenceId": "a6e7ace1-f4cb-4c2d-894d-73693164d82f",
"fieldValue": "sn9 2uh"
},
{
"fieldReferenceId": "18c837cd-1dae-4961-9164-3de23e9c954b",
"fieldValue": "0WOJ7000000XsXyOAK"
}
],
"userGroups": [],
"assignedToUsers": [],
"unassignedFromUsers": []
},
{
"formId": 9347,
"formSubmissionId": 6299592,
"createdTimeStamp": "2024-05-16T08:26:29.913",
"modifiedTimeStamp": "2024-05-16T08:26:29.93",
"fields": [
{
"fieldReferenceId": "d9005789-8b54-4b24-ab44-16723ae7ddfc",
"fieldValue": "456 Orange Crescent"
},
{
"fieldReferenceId": "a6e7ace1-f4cb-4c2d-894d-73693164d82f",
"fieldValue": "sw3 8rf"
},
{
"fieldReferenceId": "18c837cd-1dae-4961-9164-3de23e9c954b",
"fieldValue": "a1GJ7000000sZ9cMAE"
}
],
"userGroups": [],
"assignedToUsers": [],
"unassignedFromUsers": []
}
]
}
}