Forum Discussion
Hi @nirupama,
There’s a group by functionality on the Aggregate snap that will allow you to have the input data in a group after you’re done with your calculations (Aggregation).
Another option is to use a Group by N snap, with 0 in group size which will add all incoming objects to one array. After that, you’ll need to add a Mapper snap with the following expression:
$array.reduce((acc, curr)=> acc + curr, 0)
You probably going to need to amend the expression per your needs. For example if you have an array of objects, and you need to calculate a specific field (ex. “Age”) the expression will look something like this:
$array.reduce((acc,curr)=> acc + curr.Age,0)
Regards,
Bojan
The preview shows the since multiple documents can be streamed, each document being streamed is a map. The REST POST snap will take each document and write it out to the endpoint, as a map. You can change the POST endpoint to a test endpoint created in a service like https://requestb.in/, to verify whether the right data is being posted.
The Zendesk API error response would have more details. It is possible the right content type was not set, add a HTTP Header in the POST snap, with key “Content-Type” and value “application/json”