Chris Whitfield
Posts: 0
Joined: Fri Jul 26, 2013 5:31 am

$and for filtering lists

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!

Anton Artyukh5836028
Posts: 0
Joined: Wed May 08, 2013 12:57 pm

$and for filtering lists

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

Return to “Issues”