Filter a array on App Connect

Hello,

I am trying to hide a button based on the values in an array. For example, I want to filter and search a specific field in the array, qtyShipped. Then if there is a 0 in any of the values for qtyShipped.

How would I go about querying this on the front end?

You could use a .where() formatter to get all objects that have a 0 in the property qtyShipped, and then use .count() formatter to get the number of objects, and then use a > 0 condition to hide if true.

This does work, now what if the value could be 0 or null. Either way this means exactly the same in our situation.

I don't see a "where" is null.

That OR condition complicates things. You might want to pre-process the data somehow, e.g. by using a Repeat step and then use a Set Value with the .default(0) formatter on that property

Just use null instead of 0

Or just use < 1 for the where

I tried all of these and they all worked.

However I now have a similar issue but this time it has to due with comparing 2 values in the array and calculating if they equal a certain number.

For Example:
qtyShipped and qtyRequested is the same

How do I do this to equal, false or true?

Try searching the forum on "inArray" which allows you to conditionally search for the occurence of a single value inside an array.