Crystal Ege
Posts: 0
Joined: Wed Mar 26, 2014 6:58 pm

How to use the "Where" clause in a List Service Query

I'm building an app with nested lists that navigate to separate pages and display another list based upon the previous selection.

I have been able to produce list results in the where clause by using the test tab on the list service. I am also able to produce results when for example {"ParentId":"101"} is entered in the Request tab of the data service on a page.

My database has multiple fields. I am working with CatalogComponentId and ParentId. I am attempting to use a local storage variable to hold the value of CatalogComponentId and then use that variable as the ParentId value.

I am using the following code to retrieve the local storage variable and assign it the ParentId in the sub-pages where clause. But it is not working.

var value = localStorage.getItem('CatalogComponentId');
return {"ParentId": value };

Please help!

Nikita
Posts: 0
Joined: Fri Feb 28, 2014 4:02 pm

How to use the "Where" clause in a List Service Query

Hello,

Please replace
return {"ParentId": value };
with
return '{"ParentId":"' + value +'"}';

Return to “Issues”