# Complex Filter Question

**URL:** <https://community.dreamfactory.com/t/complex-filter-question/3951>\
**Category:** Server-Side Scripting\
**Tags:** rest\
**Created:** [July 14, 2017, 1:13pm UTC](https://community.dreamfactory.com/t/complex-filter-question/3951 "2017-07-14T13:13:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Harvey](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/mike_harvey/32/572_2.png) [@Mike\_Harvey](https://community.dreamfactory.com/u/Mike_Harvey)\
**Post date:** [July 14, 2017, 1:13pm UTC](https://community.dreamfactory.com/t/complex-filter-question/3951/1 "2017-07-14T13:13:04Z")

</div>

I have post script running that is calling a db service to retrieve a single record ID based on a sql like filter.

When I send the filter the API docs below it works fine:  
(InternalRole=1) AND (Organization\_Id=51) AND (Deactivated=false)

When I try the exact same filter (encoded in the query string below) in my script it return the same ID no matter what Organization\_Id I enter:  
fields=Id&limit=1&filter=(InternalRole%3D1)%20AND%20(Organization\_Id%20%3D51)%20AND%20(Deactivated%3Dfalse)

Any ideas?

---

<div class="post-metadata">

**Author:** ![Mike\_Harvey](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/mike_harvey/32/572_2.png) [@Mike\_Harvey](https://community.dreamfactory.com/u/Mike_Harvey)\
**Post date:** [July 14, 2017, 5:01pm UTC](https://community.dreamfactory.com/t/complex-filter-question/3951/2 "2017-07-14T17:01:06Z")

</div>

Doah! I figured it out. It was that damn pesky variable case sensitivity.😉
