# Customer Search using Data Service

**URL:** <https://forum.litium.com/t/customer-search-using-data-service/1033>\
**Category:** Questions\
**Created:** [August 19, 2019, 11:03am UTC](https://forum.litium.com/t/customer-search-using-data-service/1033 "2019-08-19T11:03:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gokul.gopi](https://avatars.discourse-cdn.com/v4/letter/g/53a042/32.png) [@gokul.gopi](https://forum.litium.com/u/gokul.gopi)\
**Post date:** [August 19, 2019, 11:03am UTC](https://forum.litium.com/t/customer-search-using-data-service/1033/1 "2019-08-19T11:03:34Z")

</div>

How do we compare the field value with a list of values when using the Data Service Search.

Litium version: \_[Version number]\_7

---

<div class="post-metadata">

**Author:** ![marten](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/marten/32/11_2.png) [@marten](https://forum.litium.com/u/marten)\
**Post date:** [August 19, 2019, 11:34am UTC](https://forum.litium.com/t/customer-search-using-data-service/1033/2 "2019-08-19T11:34:59Z")

</div>

Have a look at [Dataservice BoolFilterDesciptor.Should](https://forum.litium.com/t/dataservice-boolfilterdesciptor-should/290)

---

<div class="post-metadata">

**Author:** ![gokul.gopi](https://avatars.discourse-cdn.com/v4/letter/g/53a042/32.png) [@gokul.gopi](https://forum.litium.com/u/gokul.gopi)\
**Post date:** [August 19, 2019, 11:38am UTC](https://forum.litium.com/t/customer-search-using-data-service/1033/3 "2019-08-19T11:38:55Z")

</div>

I have a list of sellers, so I need to compare a field on Person to know if the person is assigned to any of the seller in the list, if I add it as foreach like below, it is not returning any results, is there a way to include a condition like this in search.

foreach (var seller in filterSeller)  
{  
request.Filter(x =\> x.Bool(  
y =\> y.Should(  
z =\> z.Field(PersonFieldNameConstants.AssignedTo, “eq”, seller.Value.ToString()))));  
}

---

<div class="post-metadata">

**Author:** ![marten](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/marten/32/11_2.png) [@marten](https://forum.litium.com/u/marten)\
**Post date:** [August 19, 2019, 11:59am UTC](https://forum.litium.com/t/customer-search-using-data-service/1033/4 "2019-08-19T11:59:55Z")

</div>

Perhaps something like this:

```auto
   .Should(should => {
      foreach (var seller in filterSeller) 
         should.Field(PersonFieldNameConstants.AssignedTo, “eq”, seller.Value.ToString());
   })));
```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/litium/original/1X/12eddac3b8b661de1db86af10ac8151b571e6fb9.png) [@system](https://forum.litium.com/u/system)\
**Post date:** [September 16, 2019, 12:08pm UTC](https://forum.litium.com/t/customer-search-using-data-service/1033/5 "2019-09-16T12:08:19Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
