One idea to make it easier for you to find Items faster is to convert the standard array to associative array. Let's understand better:
[ ]- standard array - 0 based integer indexes only
So when you define:
var arr = [ 0, 1, 2, 3 ];
you are defining a standard array where indexes can only be integers. When you do
something(which is what you use as index) is not an integer you are basically defining a property to the
PI Web API provides a standard array. I guess it you convert it to associate array, you problem would be solved.
After some research, I found this stack-overflow thread:
If you make small changes using the .forEach example, I think you will be able to achieve your goal.
Let me know if this helps you!
hi Marcos, thanks
That's essentially what those helper-functions do which I posted,
I was just wondering if there was some way to get PI Web API to respond in that format originally rather than arrays.
but the helper functions definitely are a fine workaround!
For now, there isn't. But I will forward your suggestion to the PI Web API team so they might add this feature to a future version.