Expand my Community achievements bar.

Issue with array "contains..." operators

Avatar

Level 3

Hi. Sorry. Me again. I had an array that looked like this (output of an execution): 

gardensurfer_0-1727861859451.png

 

And in my filter, the condition was intended to allow scenario to continue if "Array does not contain (case-insensitive)"... the 2nd value shown in the array "GO40290". But from this pic, you can see by the green checkmark that the filter let the bundle pass thru. 

gardensurfer_1-1727861999098.png

 

 

Did I set the filter up wrong?: 

 

gardensurfer_3-1727862199357.png

 

Should I have done something differently or am I perhaps misunderstanding how to use the filters or operators? 

 

Thanks!

 

 

 

 

4 Replies

Avatar

Level 10

Hello gardensurfer,

 

The array in your first screenshot is an "array of objects". The filter expects a simple array in a form like this:

 

['GO40290', 'BP40567', 'C040115', 'MO393313']

 

You need to check the map() function in Fusion to "convert" your array before using the filter.

 

map(complex array; key;[key for filtering];[possible values for filtering]) 

 

 

Regards

Lars

Avatar

Level 3

Wow. Thank you. I'll do that! Super helpful! 

 

Avatar

Level 3

Hi @lgaertner - would you kindly assist with a bit more guidance again? I am trying to turn the complex array in my original post into a simple one and am not meeting with success when I try to follow along with the documentation online

 

Here is the basic structure I set up. (Hope the module names are clear enough.):

gardensurfer_0-1728007485843.png

Setup & outputs of each module: 

gardensurfer_0-1728008159548.png

 

 

gardensurfer_2-1728007566618.png

gardensurfer_3-1728007590629.png

 

 

gardensurfer_4-1728007676147.png

(Output is same complex array as in my original post):gardensurfer_5-1728007702112.png

Now I get to trying to use the map() function to convert from complex to simple array. This is how I set it up: 

gardensurfer_6-1728007814019.png

 (where 40.Array[1]: Value is the protocol number I want in my simple array). 

 

Both my input and output of the "Convert to Primitive Array" module are empty arrays, though: 

gardensurfer_7-1728007913093.png

 

Can you (or anyone else, please) spot what I did wrong to be getting these results? I am still hoping to get the simple array as expected in your description above. 

 

I appreciate your help and knowledge sharing. 

 

 

 

 

Avatar

Community Advisor

The command should just be map({your array};value), with value just typed in, not mapping value in.