С учетом этого ввода
{
"0": {
"inboundAttachmentNames": [
],
"exceptionPayload": null,
"inboundPropertyNames": [
],
"outboundAttachmentNames": [
],
"payload": {
"meta": {
"totalItems": 3,
"pagingOffset": 1,
"pagingLimit": 10,
"orderBy": "",
"orderAscDesc": ""
},
"account.Account": [
{
"sourceSystem": "Salesforce",
"name": "Coca-Cola",
"accountId": "Salesforce-1",
"customerId": "Salesforce-c1"
},
{
"sourceSystem": "Salesforce",
"name": "Levi Strauss",
"accountId": "Salesforce-2",
"customerId": "Salesforce-c2"
},
{
"sourceSystem": "Salesforce",
"name": "Remmington Arms",
"accountId": "Salesforce-3",
"customerId": "Salesforce-c3"
}
]
},
"outboundPropertyNames": [
],
"attributes": {
"headers": {
"content-type": "application/json; charset=UTF-8",
"content-length": "605",
"date": "Fri, 24 Jan 2020 14:33:03 GMT"
},
"reasonPhrase": "OK",
"statusCode": 200
}
},
"1": {
"inboundAttachmentNames": [
],
"exceptionPayload": null,
"inboundPropertyNames": [
],
"outboundAttachmentNames": [
],
"payload": {
"meta": {
"totalItems": 2,
"pagingOffset": 1,
"pagingLimit": 10,
"orderBy": "",
"orderAscDesc": ""
},
"account.Account": [
{
"sourceSystem": "SAP",
"name": "addidas",
"accountId": "sap-1",
"customerId": "sap-c1"
},
{
"sourceSystem": "SAP",
"name": "BMW",
"accountId": "sap-2",
"customerId": "sap-c2"
}
]
},
"outboundPropertyNames": [
],
"attributes": {
"headers": {
"content-type": "application/json; charset=UTF-8",
"content-length": "399",
"date": "Fri, 24 Jan 2020 14:33:03 GMT"
},
"reasonPhrase": "OK",
"statusCode": 200
}
}
}
Сценарий
%dw 2.0
output application/json
import valueSet from dw::core::Objects
---
sum(valueSet(payload) map ((item) -> sizeOf(item.payload."account.Account")))