Can I filter a comma separated list with Checkbox and Attributes V2?

Is is possible to filter a comma separated list with Checkboxes using Attributes V2?

I have a string of my product features and I would love to be able to filter with a checkbox if the string contains the fs-list-value, right now I can only get it to filter if it is an exact match.

Hey @bree!

When filtering comma-separated lists with checkboxes using Finsweet Attributes v2, the default behavior should actually work for you. By default, all filters use the “contain” operator, which should allow partial matching within your comma-separated text fields.

Your checkbox setup should look like:

<div fs-list-element="filters">
  <input type="checkbox" fs-list-field="features" fs-list-value="Feature1">
  <input type="checkbox" fs-list-field="features" fs-list-value="Feature2">
</div>

And your collection item like:

<div fs-list-element="list">
  <div fs-list-field="features">Feature1, Feature2, Feature3</div>
</div>

If that’s not working, you can try explicitly adding the contain operator:

<input type="checkbox" fs-list-field="features" fs-list-value="Feature1" fs-list-operator="contain">

Or consider using a search input field for more flexible matching:

<input type="text" fs-list-field="features" placeholder="Search features...">

Could you please share your Webflow staging URL or a quick Loom video showing your setup? This would help us pinpoint exactly what’s causing the issue.

@Support-Luis or @Support-Pedro can help further with any custom code solutions if needed!

1 Like

@Support-Finn @Support-Luis @Support-Pedro

This isn’t seeming to work for me. Hopefully I am just missing something simple.

Here is the share link: Webflow - Haworth Ancillary Select

Here is the staging site: https://haworth-ancillary-select.webflow.io/

I will DM the site password!

I have highlighted the filter that I am testing with and the list field in my product card blue so you can see.

Here is the staging link: https://haworth-ancillary-select.webflow.io/

Hey @bree!

Could you please send me the site password through DM so I can review your setup?

@Support-Pedro I actually figured this one out! It needed the fs-list-operator=“contain” added to each checkbox, as the default for checkboxes is ‘equal’.

3 Likes