# Filter checkboxes with checked state

**URL:** <https://forum.finsweet.com/t/filter-checkboxes-with-checked-state/1119>\
**Category:** Attributes\
**Created:** [June 28, 2023, 4:09am UTC](https://forum.finsweet.com/t/filter-checkboxes-with-checked-state/1119 "2023-06-28T04:09:05Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![dam.kasper87](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/dam.kasper87/32/856_2.png) [@dam.kasper87](https://forum.finsweet.com/u/dam.kasper87)\
**Post date:** [June 28, 2023, 4:09am UTC](https://forum.finsweet.com/t/filter-checkboxes-with-checked-state/1119/1 "2023-06-28T04:09:05Z")

</div>

I have a form which is going to have many checkbox items populated from CMS.

How can i use the CMS filter to filter out checkboxes that has checked state?

**Live link**  
[https://www.launchr.net/experiments-wip/metrics-strategy](https://www.launchr.net/experiments-wip/metrics-strategy)  
Password: launchr213

**Sharable Link**  
[https://preview.webflow.com/preview/launchr?utm\_medium=preview\_link&utm\_source=designer&utm\_content=launchr&preview=199c7d6e6155f21c6045e8b91c39a9f1&pageId=649a9be5a5693efdd9af7007&workflow=preview](https://preview.webflow.com/preview/launchr?utm_medium=preview_link&utm_source=designer&utm_content=launchr&preview=199c7d6e6155f21c6045e8b91c39a9f1&pageId=649a9be5a5693efdd9af7007&workflow=preview)

 ![2023-06-28_11-04-26 (1)](https://europe1.discourse-cdn.com/flex013/uploads/finsweet1/original/1X/6670ccf0341429f4297852b9e250f9f677ed5574.png)

---

<div class="post-metadata">

**Author:** ![Support-Luis](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/support-luis/32/53_2.png) [@Support-Luis](https://forum.finsweet.com/u/Support-Luis)\
**Post date:** [June 28, 2023, 9:30pm UTC](https://forum.finsweet.com/t/filter-checkboxes-with-checked-state/1119/2 "2023-06-28T21:30:36Z")

</div>

hey @dam.kasper87!

This is possible with an embed element within your list and adding the `fs-cmsfilter-field = IDENTIFIER` attribute to this element.

This [thread](https://forum.finsweet.com/t/using-conditional-visible-on-text-for-filtering/582) has more info and pictures showing the process.

Let me know if you need help setting this up 🙂

---

<div class="post-metadata">

**Author:** ![dam.kasper87](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/dam.kasper87/32/856_2.png) [@dam.kasper87](https://forum.finsweet.com/u/dam.kasper87)\
**Post date:** [June 30, 2023, 7:28am UTC](https://forum.finsweet.com/t/filter-checkboxes-with-checked-state/1119/3 "2023-06-30T07:28:18Z")

</div>

@Support-Luis , This is great, and i get the concept. 😄

But i can get it working as expected.

[https://www.launchr.net/experiments-wip/metrics-strategy](https://www.launchr.net/experiments-wip/metrics-strategy)  
Password: launchr213

I’m using `fs-cmsfilter-field ="selection"` on both the toggle label and the on/off div, to filter everything with “on” as expected output, but no results are found.

 ![2023-06-30_14-26-12](https://europe1.discourse-cdn.com/flex013/uploads/finsweet1/original/1X/6c060c656913538e11c10338fee1cbcf2a6980df.jpeg)

---

<div class="post-metadata">

**Author:** ![Support-Luis](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/support-luis/32/53_2.png) [@Support-Luis](https://forum.finsweet.com/u/Support-Luis)\
**Post date:** [June 30, 2023, 3:26pm UTC](https://forum.finsweet.com/t/filter-checkboxes-with-checked-state/1119/5 "2023-06-30T15:26:27Z")

</div>

@dam.kasper87 you should be using a switch in your CMS Collection for this. This switch should be toggled on for items that you want to show when the `Selected Metrics` or `North Star Metrics` filter is applied.

 ![Screen Shot 2023-06-30 at 09.17.12](https://europe1.discourse-cdn.com/flex013/uploads/finsweet1/original/1X/de179da5de66fffdfca6542fdf84662a31d2d2d0.png)

Your embed should look like this and it should show `true/false` depending on the state of the switch, you should add the `fs-cmsfilter-field = IDENTIFIER ` to the element custom attribute panel as the picture shows below.

 ![Screen Shot 2023-06-30 at 09.24.32](https://europe1.discourse-cdn.com/flex013/uploads/finsweet1/original/1X/8b75ec49ee6d66bea14cf325dba83349747399e2.jpeg)

---

<div class="post-metadata">

**Author:** ![dam.kasper87](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/dam.kasper87/32/856_2.png) [@dam.kasper87](https://forum.finsweet.com/u/dam.kasper87)\
**Post date:** [July 4, 2023, 7:08am UTC](https://forum.finsweet.com/t/filter-checkboxes-with-checked-state/1119/6 "2023-07-04T07:08:36Z")

</div>

@Support-Luis This makes sense for the North Star Metrics, as i can mark these as North Stars on/off on the CMS.

Not i don’t fully understand how i can apply this on the “Selected Metrics”, as the user is selecting and de-selecting them right there on the session itself.

So the “Selected Metrics” is actually based on dynamic information pr. session. Not static from the CMS.

I have recorded a 90 second video to give some more context on this issue 🤝

[https://www.screencast.com/t/5vqGmwgd2](https://www.screencast.com/t/5vqGmwgd2)

---

<div class="post-metadata">

**Author:** ![Support-Luis](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/support-luis/32/53_2.png) [@Support-Luis](https://forum.finsweet.com/u/Support-Luis)\
**Post date:** [July 4, 2023, 3:19pm UTC](https://forum.finsweet.com/t/filter-checkboxes-with-checked-state/1119/7 "2023-07-04T15:19:53Z")

</div>

Thanks for the video @dam.kasper87! I now see what you are after and you are right, this will not work for the Selected Metrics by the user.

We can try to use some costume code to filter out the list, if you are confident with some code you can start with the [Attributes API](https://finsweet.com/attributes/api/cms-filter).

---

<div class="post-metadata">

**Author:** ![dam.kasper87](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/dam.kasper87/32/856_2.png) [@dam.kasper87](https://forum.finsweet.com/u/dam.kasper87)\
**Post date:** [July 9, 2023, 12:56pm UTC](https://forum.finsweet.com/t/filter-checkboxes-with-checked-state/1119/8 "2023-07-09T12:56:40Z")

</div>

@Support-Luis - I reviewed your API, but i don’t see any obvious way to filter based on dynamic values which are not coming from collection or database.

Did you handle this scenario before? Any pointer or hint would be helpful. And coding is no issue. 🙏🏻

---

<div class="post-metadata">

**Author:** ![Support-Luis](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/support-luis/32/53_2.png) [@Support-Luis](https://forum.finsweet.com/u/Support-Luis)\
**Post date:** [July 11, 2023, 10:04pm UTC](https://forum.finsweet.com/t/filter-checkboxes-with-checked-state/1119/9 "2023-07-11T22:04:21Z")

</div>

@dam.kasper87 I have not handled this scenario before, usually we have no user interaction within the list.

One idea that I have in mind is for us to change the text/value of a hidden text block within the items that changes if the item is selected by the user. Kind of like what you are doing now for the styling. This element will be our ‘Selected by user’ identifier for CMS Filter.

If you can do this we can then go into the API to see how we can update the filter’s info so that when we apply the filter only the selected items stay in place.

---

<div class="post-metadata">

**Author:** ![dam.kasper87](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/dam.kasper87/32/856_2.png) [@dam.kasper87](https://forum.finsweet.com/u/dam.kasper87)\
**Post date:** [July 12, 2023, 4:37am UTC](https://forum.finsweet.com/t/filter-checkboxes-with-checked-state/1119/11 "2023-07-12T04:37:32Z")

</div>

I solved this through custom code and outside your API. It was a bit tricky, but works now. ✊ Thanks for your help 😃

---

<div class="post-metadata">

**Author:** ![dam.kasper87](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/dam.kasper87/32/856_2.png) [@dam.kasper87](https://forum.finsweet.com/u/dam.kasper87)\
**Post date:** [July 12, 2023, 1:49pm UTC](https://forum.finsweet.com/t/filter-checkboxes-with-checked-state/1119/12 "2023-07-12T13:49:50Z")

</div>



---

<div class="post-metadata">

**Author:** ![Support-Luis](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/support-luis/32/53_2.png) [@Support-Luis](https://forum.finsweet.com/u/Support-Luis)\
**Post date:** [July 12, 2023, 3:31pm UTC](https://forum.finsweet.com/t/filter-checkboxes-with-checked-state/1119/13 "2023-07-12T15:31:10Z")

</div>

@dam.kasper87 I am glad you got this working as you wanted!
