# CMS Filters not working

**URL:** <https://forum.finsweet.com/t/cms-filters-not-working/1911>\
**Category:** Attributes\
**Created:** [September 13, 2023, 5:20pm UTC](https://forum.finsweet.com/t/cms-filters-not-working/1911 "2023-09-13T17:20:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![v11](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/v11/32/1328_2.png) [@v11](https://forum.finsweet.com/u/v11)\
**Post date:** [September 13, 2023, 5:20pm UTC](https://forum.finsweet.com/t/cms-filters-not-working/1911/1 "2023-09-13T17:20:10Z")

</div>

This is a strange one. In my Chrome browser where I’m logged into Webflow my filters work great.

On Chrome incognito, plus all other browsers (Safari, Firefox) they don’t work.

@Support-Luis Any ideas what’s going on?

Site:

[https://preview.webflow.com/preview/great-ads?utm\_medium=preview\_link&utm\_source=designer&utm\_content=great-ads&preview=439cc7004d36950d559620c6ca522aa2&workflow=preview](https://preview.webflow.com/preview/great-ads?utm_medium=preview_link&utm_source=designer&utm_content=great-ads&preview=439cc7004d36950d559620c6ca522aa2&workflow=preview)

---

<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:** [September 14, 2023, 8:28am UTC](https://forum.finsweet.com/t/cms-filters-not-working/1911/2 "2023-09-14T08:28:25Z")

</div>

Hey @v11! It seems this code is causing the issue

```auto
// Hide/Show save-button and saved-note based on user's saved items
            const currentMemberJSON = await window.$memberstackDom.getMemberJSON();

            // Drill down into the nested 'data' properties
            let memberData = currentMemberJSON;
            while (memberData && memberData.data) {
              memberData = memberData.data;
            }

            // Check if the 'adIds' property exists and is an array
            const adIdsArray =
              memberData.adIds && Array.isArray(memberData.adIds) ? memberData.adIds : [];

            // Hide 'save-button' and show 'saved-note' for each CMS item that's in the member's JSON
            adIdsArray.forEach((adIdValue) => {
              $('.save-button[data-ad-id="' + adIdValue + '"]').hide();
              $('.saved-note[data-ad-id="' + adIdValue + '"]').show();
            });

```

This new callback logs the error instead of breaking the script

```auto
// Combined CMS Load callback
      window.fsAttributes.push([
        'cmsload',
        async (listInstances) => {
          console.log('cmsload Successfully loaded!');

          const [listInstance] = listInstances;

          listInstance.on('renderitems', async (renderedItems) => {
            console.log(renderedItems);

            // Ensure Mux script is loaded and reinitialize videos
            ensureMuxScriptLoaded(initializeMuxVideos);

            try {
              // Hide/Show save-button and saved-note based on user's saved items
              const currentMemberJSON = await window.$memberstackDom.getMemberJSON();

              // Drill down into the nested 'data' properties
              let memberData = currentMemberJSON;
              while (memberData && memberData.data) {
                memberData = memberData.data;
              }

              // Check if the 'adIds' property exists and is an array
              const adIdsArray =
                memberData.adIds && Array.isArray(memberData.adIds) ? memberData.adIds : [];

              // Hide 'save-button' and show 'saved-note' for each CMS item that's in the member's JSON
              adIdsArray.forEach((adIdValue) => {
                $('.save-button[data-ad-id="' + adIdValue + '"]').hide();
                $('.saved-note[data-ad-id="' + adIdValue + '"]').show();
              });
            } catch (error) {
              console.log('An error has occurred: ', error);
            }
          });
        },
      ]);

```

Let me know if this fixes your issue 💪

---

<div class="post-metadata">

**Author:** ![v11](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/v11/32/1328_2.png) [@v11](https://forum.finsweet.com/u/v11)\
**Post date:** [September 14, 2023, 10:40am UTC](https://forum.finsweet.com/t/cms-filters-not-working/1911/3 "2023-09-14T10:40:35Z")

</div>

Legend. I got it working. Thanks man!
