I have API response in this format:
[
{
"id": 321312,
"code": "0430d2e5-37ae-4176-b39c-2ac741c8c032",
"workflowStage": {
},
"properties": [
{
"id": 321312,
"name": "Saved Files",
"propertyGroupId": 321312,
"priority": 1,
"type": "system",
"system": true,
"systemType": "files",
"systemName": "0e9af7b9-89b6-48a3-9b56-659194212965",
"value": []
},
{
"id": 321312,
"name": "Active",
"propertyGroupId": 321321,
"priority": 6,
"type": "system",
"system": true,
"systemType": "last_activity",
"systemName": "9f0705ea-5cb5-4fc0-a734-fc96a6f13684",
"value": "2024-04-10T16:50:30+02:00"
}
// more properties
],
"persons": [],
"anonymized": false,
"documentVersions": [
{
"id": 321321,
"code": "bd46d0c3-d8ce-411b-8ffe-06ca6c4ab9e0",
"parentId": null,
"deleted": false,
"templateSuiteId": 123123,
"created": "2024-04-10T16:50:30+02:00",
"authorId": 321312,
"languageId": 1,
"documentRecordId": 321312,
"documentRecordCode": "0430d2e5-37ae-4176-b39c-2ac741c8c032",
"templates": [
{
"id": 321321,
"templateSuiteId": 321312,
"name": "salesForceOppTest",
"type": "document",
"noExport": false,
"internal": false,
"priority": 1000
}
]
}
// more document versions
],
"events": [
]
},
{
// other document record
}
]
And I need to change the dates in properties with parseDate to go public.
But when I use an iterator to iterate through arrays I have an array in an array and the iterator has weird behavior. For example when I do this:
"response": {
"iterate": "{{body}}",
"output": {
"id": "{{item.id}}",
"code": "{{item.code}}",
"created": "{{parseDate(item.created, 'YYYY-MM-DDTHH:mm:ssZ', 'Europe/Prague')}}",
"lastModified": "{{parseDate(item.lastModified, 'YYYY-MM-DDTHH:mm:ssZ', 'Europe/Prague')}}",
"active": "{{parseDate(item.active, 'YYYY-MM-DDTHH:mm:ssZ', 'Europe/Prague')}}",
"name": "{{item.name}}",
"properties": {
"iterate": "{{item.properties}}",
"output": {
"value": "{{parseDate(item.value, 'YYYY-MM-DDTHH:mm:ssZ', 'Europe/Prague')}}"
}
},
"documentVersions": {
"iterate": "{{item.documentVersions}}"
},
"events": {
"iterate": "{{item.events}}",
"eventCreated": "{{parseDate(item.created, 'YYYY-MM-DDTHH:mm:ssZ', 'Europe/Prague')}}"
}
},
"limit": "{{parameters.limit}}"
}
It gives me this in properties:
Or this in documentVersions:
But neither works and I don’t know how to use the iterator properly.
I need to just have an array of properties under “properties” with parsed dates and the same thing in the document versions.