Hi,
I am working on a workflow which is used to generate a report based on a set of json data.
I am trying to figure out how to setup some global variables to track specific things throughout the entire workflow.
For example, in the data object I have a key called Type which can have 5 different values. The json data contains many objects (hundreds) each with the Type key but with one of the 5 values:
“Type” can be either "JavaScript, eTag, First Party Cookie, Third Party Cookie or Local Storage.
I need to count how many instances of each type occur in the json data and store them as a variable so when I get to the end of my workflow (which builds the report) I can use the variables in the report.
For example - I might have 547 different objects in the json Data with the following breakdown for the Type key:
JavaScript: 293
eTag: 142
First Party Cookie: 27
Third Party Cookie: 49
Local Storage: 36
I cannot see how to store them and access them globally within the workflow so I can use them to dynamically generate the report at the end. I have no issue counting them, I can do that with a generic code node and for loop but when I iterate and update the counts accordingly, it saves the count at each iteration directly into the main $item.json object as opposed to separate variables outside of the items (I hope that makes sense).
Thanks in advance.