Hi Michael,
To get your query service work correctly you can follow these sollution:
1 Open datasource mapping on request tab.
2 Find "where" request parameters and click "Add JS/Edit JS" button. http://prntscr.com/3ps6w8/direct
3 JS editor appears. Populate it with folowing JS code:
pre
//You can change these variables with values you need. But try to test with static values before.
var westlothian = "y";
var falkirk = "n";
//This is "and" login you can use "$or" if you need it.
var whereObject = {"$and": [ {"westlothian": westlothian }, {"falkirk": falkirk } ] };
return JSON.stringify(whereObject);
/pre
Regards.