Using operator != with the map() function

Hi,

I’m pretty sure the answer is no to the following question but just want to double check! :slightly_smiling_face:

I have a Parse JSON module outputting an array. I was trying to use the map function to filter all guest where dietary preference != none.

I can add the != operator, save the scenario and run it. But after running it seems to remove the != so I get the guest name where dietary preference is none instead.

Is this expected behaviour? To get an array of guests where dietary preference != none I would have to use an Iterator and Array Aggregator with a filter in between?

Also am I correct in saying that there is no way to use map and maintain all the properties of the originating object? ie. I can only map one property, like name in this case?

Thanks!
Brian

You can’t have a negative comparison in a map function.

Use an Iterator-Array Aggregator combo, and you can create a filter between them.

Alternatively, you can use a Text Parser module to match the elements out of the JSON before you use Parse JSON.

Hope this helps! Let me know if there are any further questions or issues.

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.