# Filter based on field in a referenced CMS

**URL:** <https://forum.wixstudio.com/t/filter-based-on-field-in-a-referenced-cms/63675>\
**Category:** Ask the community\
**Tags:** question, wix-studio, cms\
**Created:** [October 18, 2024, 3:30am UTC](https://forum.wixstudio.com/t/filter-based-on-field-in-a-referenced-cms/63675 "2024-10-18T03:30:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Seej](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/seej/32/80475_2.png) [@Seej](https://forum.wixstudio.com/u/Seej)\
**Post date:** [October 18, 2024, 3:30am UTC](https://forum.wixstudio.com/t/filter-based-on-field-in-a-referenced-cms/63675/1 "2024-10-18T03:30:13Z")

</div>

Wix Studio

I would like to filter a dataset (both within the CMS and the dataset settings) by the tag of a referenced CMS.

**CMS 1**  
Field 1 (Primary): Name  
Field 2 (Tag): A,B,C

**CMS 2:**  
Field 1 (Primary): Name  
Field 2: Rich text  
Field 3: Reference CMS 1

I would like to filter CMS 2 by the tag field of CMS 1.  
Eg. Filter the data to only show the rows that have A or B.

How would I achieve this?

---

<div class="post-metadata">

**Author:** ![amandam](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/amandam/32/79539_2.png) [@amandam](https://forum.wixstudio.com/u/amandam)\
**Post date:** [October 21, 2024, 5:50pm UTC](https://forum.wixstudio.com/t/filter-based-on-field-in-a-referenced-cms/63675/2 "2024-10-21T17:50:17Z")

</div>

If you search teh forum there are some other posts similar to what you are trying to achieve. Here is one, for example, that may give you an idea of how to get started

> [@How to filter a dataset with a multi reference](https://forum.wixstudio.com/t/how-to-filter-a-dataset-with-a-multi-reference/32340):
>
> Hi, I have a dataset (dataset1) with a reference record. In this record you can select multiple values from an other dataset (dataset2). dataset1 [image] dataset2 [image] Question : How can I filter this dataset with code? I tried: $w('#dataset1').setFilter(wixData.filter().hasSome("eventTyp","2")); Result have to be : Event 1 and Event 2
