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