I am using Xtensions to call an internal web API that returns data in JSON format, and I now want to parse through that JSON to get the value I want. The workflow action that calls the API will store the result in a collection variable. I have to use a “Get item from collection” action to make it readable by the “Query JSON” action. I do this all time for the easy stuff. Now I have an issue because now the value I want is within an array of values in the JSON. If I did a Query JSON action, I would have to use something like  or  in the JSON expression to obtain the first entry, or the second entry, etc. I want to loop through all the entries.
My idea is that I can “Query JSON” to obtain the portion of JSON that contains that array, then I can do a loop action or For Each action. However, when I use “Count items in collection” it only returns a count of 1. This is incorrect. In my test data, there should be 5 items. Is there another method of counting these items?
Another thing it keeps doing is adding escape characters, like the \ slash. I see them when I do a “Log to instance details.” I think these are messing up my Query JSON commands. Is anything else dealing with this and have ideas?
Best answer by PabloLView original