How to find latest element in json array with Property Transfer
Hi all,
I have responce form GET request in Json like:
[
{
"CompanyID": 374982,
"CompanyStatus": 10,
"IsKeyContact": true,
"IsAuthorisedSignatory": true,
"SubscriptionStatus": 0,
"TelephoneWork": {
"ContactID": 551205,
"CommunicationMethodTypeID": 1,
"CommunicationMethodValue": "",
"ContactCommunicationsID": 1580166,
"IsPrimary": true,
"CommunicationTypeEnum": 1,
"CommunicationTypeName": "Telephone (Work)",
"IsEmail": false,
"IsPhone": true,
"UsedAsOsEmail": null,
"IsTPS": false
},
{
"CompanyID": 374982,
"CompanyStatus": 10,
"IsKeyContact": false,
"IsAuthorisedSignatory": false,
"SubscriptionStatus": 0,
"TelephoneWork": {
"ContactID": 551206,
"CommunicationMethodTypeID": 1,
"CommunicationMethodValue": "",
"ContactCommunicationsID": 1580151,
"IsPrimary": true,
"CommunicationTypeEnum": 1,
"CommunicationTypeName": "Telephone (Work)",
"IsEmail": false,
"IsPhone": true,
"UsedAsOsEmail": null,
"IsTPS": false
}
]
And quantity of elements in the array is defferent time to time.
I'm using Property Transfer with script $..ContactID[0] to define first element "ContactID": 551206 and past to property.
How is possible to define latest ContactID ?
script $..ContactID[last()] doesn't work!