Help! I’m going crazy …
Here, I would like to count the number of fields that are present in each Bundle of my Json, to make a total sum. But it does not work the numeric aggregator returns me 0 in output and even 0 in input!
What I want to count is, the number of variables present here, for each bundle:
Check this first your array is not returned like I’ve mentioned above.
If you’re in Make you’ve to understand this first and think about it.
⇒ Most of the time array always has multiple collections. The collection has multiple items in key: value pairs. → https://www.make.com/en/help/tools/json#collection-vs--array
Now in your case first check that key under the collection which you need to use as a calculation. If there are multiple calculations you need to perform then use the module Set Multiple Variables. This is my created response on another post, it’s not the same but the function usage screenshot is helpful Need Help Accessing Results from All Modules Before Numeric Aggregator in Scenario - #4 by dilipborad
Your example function syntax looks like this. sum(map(array;key))
Thanks for your answer.
But this solution only returns the number of collections (87 in my case) while I want to know the number of items - key:value pair - that there are in each collection (87*24 items, in my case), to then add them together to know the total number of items independently of the number of collections (2088 in my case).
I think the problem in your answer is that I will have to map the name of the keys in the “set multiple variable” module. Am I wrong? However, I do not know in advance the name of the key that will be present in each collection.
Thank you very much, we are moving towards the solution!
I have converted to array as you see below, I have 87 collections containing a key:value pair collection.
but when I find the length of the array, it gives me the result ‘15’ … I do not know at all where the result comes from …