Page 1 of 1

$and for filtering lists

Posted: Wed Aug 07, 2013 11:32 pm
by Chris Whitfield

Hi,

I'm trying to allow my users to get a list of items from the appery database based upon the filters that they have selected. I have basically created 2 "select" components which represent two different columns in the database. Each "select" component has a few options for the user to select. I also added a button called "filter".

So far, ive made every option on the two "select" components store as a local variable and also when you click "filter" it invokes the list service.

I can't seem to figure out how to combine the two selections into an "and" statement from each "select" component.

Thanks for your help!


$and for filtering lists

Posted: Thu Aug 08, 2013 6:20 am
by Anton Artyukh5836028

Hi Chris,

In JS-code for "where" request option add some thing like this:

precodereturn '{ "$and": ['+
'{"field1":" '+localStorage.getItem("value1")+'"},'+
'{"field2":" '+localStorage.getItem("value2")+'"}'+
'] }';/code/pre