Page 3 of 5

How to use search to query multiple database columns

Posted: Tue Jan 27, 2015 4:01 am
by Ellen Schlechter

I added that and it still doesn't work.


How to use search to query multiple database columns

Posted: Tue Jan 27, 2015 4:36 am
by M&M

Doesn't work like in empty result? Or is there an error in the console log or something?


How to use search to query multiple database columns

Posted: Tue Jan 27, 2015 4:37 am
by Ellen Schlechter

Empty result


How to use search to query multiple database columns

Posted: Tue Jan 27, 2015 4:38 am
by M&M

Like Mr. Yurii had mentioned just have a look in the console and see what parameters the query is being used with
https://d2r1vs3d9006ap.cloudfront.net...

And also confirm if there are records matching those multiple conditions. Having no records matching the criteria is one thing but failing to run a query is another thing


How to use search to query multiple database columns

Posted: Tue Jan 27, 2015 4:48 am
by M&M

I'd say start small and narrow down on the problem. Why don't you just add one parameter in your Request parameters and check out the result in the Service Test tab? Then you can add multiple conditions with the $and operator.

Here's an example where the query takes 2 parameters and returns results that match both the conditions

*****************************************************************************************

Image

And ya the query assumes that the column names are "Category" and "Estate"

The result of this (in the Service test tab) will be records matching Category = Confectionery and Estate = Ixora. You can add more parameters....fiddle around with it for a few mins till you get a hang of it

It's pretty straightforward. For the param name just add "where" and the value will be {"$and": [{"Category": "Confectionery"}, {"Estate": "Ixora"}]}

just remember to change the colum names and the looked up values as per your set up

*****************************************************************************************

How to use search to query multiple database columns

Posted: Tue Jan 27, 2015 4:50 am
by M&M

And ya your var color statement, there is one extra space in the component name, at the end

var color =Apperyio('mobiletextinput_406color ').val(); // Note extra space in component name


How to use search to query multiple database columns

Posted: Wed Jan 28, 2015 5:30 am
by Ellen Schlechter

Now it acts like it searching but if I search for something that I know shouldn't have any results, it doesn't change anything. This looks right?? Image

The errors in the console are unrelated to this issue.


How to use search to query multiple database columns

Posted: Wed Jan 28, 2015 6:54 am
by M&M

Well, you may want to validate couple of things. For example say one of the text / search parameter is not input by the user - you may want to prompt, or handle it.

Empty / null values should always be handled properly otherwise you may end up getting weird results. As for the query parameters, it looks ok. Are you still running into some problems?


How to use search to query multiple database columns

Posted: Wed Jan 28, 2015 5:01 pm
by Ellen Schlechter

Well I don't really understand what you just said but it doesn't change what is already displayed on the page.


How to use search to query multiple database columns

Posted: Mon Feb 02, 2015 8:15 am
by Ihor Didevych

Hi Ellen,
This looks right??
It doesn't change anything.
The result of service are applied only to mapped elements.
What you are planing to change and how did you made implementation of it ?