# Dataset filter stopped working

**URL:** <https://forum.wixstudio.com/t/dataset-filter-stopped-working/30115>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [January 9, 2020, 8:38am UTC](https://forum.wixstudio.com/t/dataset-filter-stopped-working/30115 "2020-01-09T08:38:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nvanevski](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/nvanevski/32/6780_2.png) [@nvanevski](https://forum.wixstudio.com/u/nvanevski)\
**Post date:** [January 9, 2020, 8:38am UTC](https://forum.wixstudio.com/t/dataset-filter-stopped-working/30115/1 "2020-01-09T08:38:22Z")

</div>

Hi guys,  
I have an issue with setting a filter to a dataset - code that was originally working, stopped working without any change. I am applying a filter to a dataset, and in the then() function, showing or hiding certain fields based on the filter outcome.  
Since two days ago, the **setFilter()** function stopped working - neither the code in then() function executes, nor the code in the catch() portion. Is anyone aware in any change of the **setFilter()** behavior?  
This is the code in question:

```javascript
let prdFilter = wixData.filter().eq('productKey', prdId).eq('language', lng);

$w('#dsProducts').setFilter(prdFilter).then( () => {
    // This part does not execute
    $w('#bxProductDetails').show();
}).catch((error)=>{
    // Neither does this part
    console.log(error)
});

```

Note that the dataset contains the records being filtered (when I tried to query the dataset using wixData.query(), it returned the items). However the setFilter() promise does not enter either in the then() function, nor in the catch() function. Collection field names, element names etc. are correct. There are no errors in the console. I tried debugging the JS on both Chrome and Firefox with breakpoints in the show() and log() lines, and the execution does not stop.  
What am I doing wrong? This code used to work earlier!

Thanks in advance!  
Nikola

---

<div class="post-metadata">

**Author:** ![aleksf](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/aleksf/32/5080_2.png) [@aleksf](https://forum.wixstudio.com/u/aleksf)\
**Post date:** [January 9, 2020, 1:14pm UTC](https://forum.wixstudio.com/t/dataset-filter-stopped-working/30115/2 "2020-01-09T13:14:38Z")

</div>

Hi Nikola,  
The code seems to be correct. If it worked previously and now don’t, it looks like unexpected behavior. Please contact Wix support [here](https://support.wix.com/en/about-wix/contacting-wix-support) so they can take a look into the issue. When creating a ticket, please include the name of the site and the name of the page with the code.

---

<div class="post-metadata">

**Author:** ![nvanevski](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/nvanevski/32/6780_2.png) [@nvanevski](https://forum.wixstudio.com/u/nvanevski)\
**Post date:** [January 12, 2020, 9:57am UTC](https://forum.wixstudio.com/t/dataset-filter-stopped-working/30115/3 "2020-01-12T09:57:03Z")

</div>

Just to update on the issue: I deleted the page and recreated it from scratch, and the filter started working. No idea what was the underlying cause. I have not faced the issue since.
