Accessing array elements in a condition

My use case:

  • Run connector function to return an object array
  • Use the handy MAP_TO_X functions to separate the object array out into simpler arrays
  • Run 6 triggers (a FOR loop sure would be nice :grin:) to make decisions based on a boolean value in one of the simple arrays (ā€œisActiveā€)

My ā€˜issueā€™ is that I canā€™t access the individual elements of the array from the condition and instead have to use a separate set of 6 triggers to ā€˜Get from indexā€™ the simple array values in to non-array datatypes in order to evaluate them. If I could just do something like ā€˜Variable.My Array[0]ā€™ it would eliminate those latter 6 triggers, as well as all of the non-array variables. Iā€™m looking at 24 variables for the 4 arrays.

Am I missing some functionality somewhere that might make this easier?

Hmmm. Have you tried using the for loop ā€œhackā€? Where you switch back and forth between 2 steps using ā€œstep openā€ triggers to iterate through the array?

That is the current most popular way to implement ā€œforā€ loops until we develop this capability natively. It sounds like this would be the best way to solve it.

Havenā€™t tried it yet but donā€™t think it would be great for this application. I can make it work with the individual variables for now. Thanks!

Just adding my two cents here. It would be nice to be able to have this feature because it would extend what we can do with items received from connectors without having more intermediate steps just to use that data if it returns an array. Also would allow a bit more dynamic applications and simply ease of use. Not having to make variables for every element in array just do to a comparison would save time and is better since data isnā€™t being duplicated.

1 Like