Formula Filter - Filtering by list of objects?

Hi,

I’m trying to use the filter on a formula but I’m not getting the result I want.

Here is the original list I’m trying to filter where you can clearly see the attributes I want to filter by.

Here is the list of attributes that I’m passing in the condition filter. (as a list of objects as per the original list above)

and here is the result.

I’ve tried different operators in the condition, to no avail.

What am I doing wrong ?

Thanks,
Jean

Sadly, the current operators can’t compare objects, only primitives values like string and number.

You still can do it if you manage to get the string version of your attributes, included in you object.

{
  sku: "..."
  attributesAsString: ["{value: 'Brown', attribute: 'Color'}", "{value: '1000mm', attribute: 'Size'}"]
}

So you can the filter with Has all of and bind an array containing the text version of your attributes you want to match. You have the formula toText to convert your objects to the text version.

1 Like

Thank you Alexis,
In the end I used a different approach. This was my workaround for anyone else that might stumble upon this post.
image

1 Like