This seems to be working fine, however when I use the DA in a script action to get the values I have to use a List Variable to write the output in. But nothing seems to be written in the List Variables when running the Custom Action.
Idealy I would like to have the total of the Idle and Interacting users as 1 integer in Scripter, not sure if this is possible. Otherwise I would like to see the retrieved data so I can make decisions based on the data.
I think I am missing something here, and I have searched the documentation and this forum but was not able to find a solution. If anyone has an idea that would be great!
Could you post an export of your data action, and the output of the execution step in test mode? Feel free to redact anything if needed, just keep the shape of the data the same.
The cause of your pain was that in your transformation map you have lines like this: "IDLE": "$.results[0].data[?(@.qualifier=='IDLE')].stats.count",
While that is the correct way to get the value, because it involves a filter like this [?(@.qualifier=='IDLE')] it is returning an array of values since there is no way ahead of time to know how many values it will match. We created the $successTemplateUtils.firstFromArray macro to help you out with situations like this. I also had to force velocity to treat the counts as numbers for the math operation to work. Finally, you will need to update your output contract to be numbers instead of arrays of numbers.