# The right way to collaborate between off-the-shelf and Velo-coded filters

**URL:** <https://forum.wixstudio.com/t/the-right-way-to-collaborate-between-off-the-shelf-and-velo-coded-filters/50090>\
**Category:** Ask the community\
**Tags:** wix-studio, question, code, general, cms\
**Created:** [May 23, 2023, 3:55pm UTC](https://forum.wixstudio.com/t/the-right-way-to-collaborate-between-off-the-shelf-and-velo-coded-filters/50090 "2023-05-23T15:55:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yoshimoto-masashi-19](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/yoshimoto-masashi-19/32/37501_2.png) [@yoshimoto-masashi-19](https://forum.wixstudio.com/u/yoshimoto-masashi-19)\
**Post date:** [May 23, 2023, 3:55pm UTC](https://forum.wixstudio.com/t/the-right-way-to-collaborate-between-off-the-shelf-and-velo-coded-filters/50090/1 "2023-05-23T15:55:25Z")

</div>

I have a question about the site of Wix Editor X, a real estate company.  
“Pull-down menu style filter connected to content manager dataset” and “property search function implemented with Velo code” (shown below) do not work at the same time. How can I solve this?

import wixData from ‘wix-data’ ;

$w . onReady ( function (){

```
const searchbox1 = $w ( "#searchbox1" ) 
const switch1 = $w ( "#switch1" ) 
const propertyDataset1 = $w ( "#propertyDataset1" ) 
$w ( "#propertyDataset1" ). onReady ( () => { 
            var count = $w ( "#propertyDataset1" ). getTotalCount (); 
            var str = count . toString () 
            $w ( "#itemNumber" ). text = str ; 
    }) 

switch1 . onChange ( function ( event ){ 
    const dealedFilter = wixData . filter (). eq ( "dealed" , **true** ) 
    const dealedNotYetFilter = wixData . filter (). eq ( "dealed" , **false** ) 
    let isChecked = $w ( "#switch1" ). checked ; 
    
    if ( isChecked == **false** ){ 
        propertyDataset1 . setFilter ( dealedFilter . or ( dealedNotYetFilter )) 

        $w ( "#propertyDataset1" ). onReady ( () => { 
            var count = $w ( "#propertyDataset1" ). getTotalCount (); 
            var str = count . toString () 
            $w ( "#itemNumber" ). text = str ; 
    }) 
    } 
    **else** { propertyDataset1 . setFilter ( dealedNotYetFilter )} 

        $w ( "#propertyDataset1" ). onReady ( () => { 
            var count = $w ( "#propertyDataset1" ). getTotalCount (); 
            var str = count . toString () 
            $w ( "#itemNumber" ). text = str ; 
    } ); 

}) 

searchbox1 . onInput ( function ( event ){ 
    //入力値を受け取る 
    const inputValue = event . target . value ; 
    //console.log(inputValue) 
    
    const titlefilter = wixData . filter (). contains ( "title" , inputValue ) 
    const address0Filter = wixData . filter (). contains ( "address0" , inputValue ) 
    const address1Filter = wixData . filter (). contains ( "address1" , inputValue ) 
    const typeFilter = wixData . filter (). contains ( "type" , inputValue ) 
    const yearBuiltFilter = wixData . filter (). contains ( "yearBuilt" , inputValue ) 
    const structureFilter = wixData . filter (). contains ( "structure" , inputValue ) 
    //各フィルターをorメソッドで結合 
    const inputFilter = titlefilter . or ( address0Filter ). or ( address1Filter ). or ( typeFilter ). or ( yearBuiltFilter ). or ( structureFilter ) 
    //データセットのフィルター条件にinputFilterの値をセット 
    propertyDataset1 . setFilter ( inputFilter ) 

}) 

```

})

$w ( “#propertyDataset1” ). onCurrentIndexChanged ( () =\> {  
var count = $w ( “#propertyDataset1” ). getTotalCount ();  
var str = count . toString ()  
$w ( “#itemNumber” ). text = str ;  
})

---

<div class="post-metadata">

**Author:** ![noahlovell](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/noahlovell/32/118920_2.png) [@noahlovell](https://forum.wixstudio.com/u/noahlovell)\
**Post date:** [May 25, 2023, 1:24pm UTC](https://forum.wixstudio.com/t/the-right-way-to-collaborate-between-off-the-shelf-and-velo-coded-filters/50090/2 "2023-05-25T13:24:16Z")

</div>

I’d recommend asking this question the Velo forum as they’ll likely be able to help best

---

<div class="post-metadata">

**Author:** ![yoshimoto-masashi-19](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/yoshimoto-masashi-19/32/37501_2.png) [@yoshimoto-masashi-19](https://forum.wixstudio.com/u/yoshimoto-masashi-19)\
**Post date:** [May 26, 2023, 2:18pm UTC](https://forum.wixstudio.com/t/the-right-way-to-collaborate-between-off-the-shelf-and-velo-coded-filters/50090/3 "2023-05-26T14:18:54Z")

</div>

Thank you.
