Tommy Thomas
Posts: 0
Joined: Thu Mar 06, 2014 3:44 pm

Boolean Filter assistance

Mapping a database collection to a list, I have a boolean field called "isActive" and I'd like to only display items in the list that are set to "isActive:true"

I'm assuming I do this in my mapping from the $ to the listitem. How's it written where I only return true items?

codereturn isActive(true);/code

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Boolean Filter assistance

Hi Tommy -

Show us example of your DB structure.

Tommy Thomas
Posts: 0
Joined: Thu Mar 06, 2014 3:44 pm

Boolean Filter assistance

I'm sure I just add it to the Edit JS button where the $ is associated with the listitems... Just don't know the small bit of code: return isActive = true;

Tommy Thomas
Posts: 0
Joined: Thu Mar 06, 2014 3:44 pm

Boolean Filter assistance

Maybe a "where isActive=true"

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Boolean Filter assistance

What service your are calling?
Expression will look like this for testing service tab:
pre
where={"isActive": {"$exists":true}}
/pre

Tommy Thomas
Posts: 0
Joined: Thu Mar 06, 2014 3:44 pm

Boolean Filter assistance

I don't know, I just want to bring over the items that are marked "true" so basically list all items that have the column "isActive" set as 'true' and not list the ones marked as 'false'...

Tommy Thomas
Posts: 0
Joined: Thu Mar 06, 2014 3:44 pm

Boolean Filter assistance

That code above did not work but I may be putting it in the wrong spot ...

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Boolean Filter assistance

Hello! You don't need to add any JS mapping. You can just map from isActive field to listitem visible property.

Tommy Thomas
Posts: 0
Joined: Thu Mar 06, 2014 3:44 pm

Boolean Filter assistance

That's awesome! Thanks! I couldn't wait to try it and it worked. So easy... :)

Return to “Issues”