Page 10 of 13
More Detail on using the select menu
Posted: Fri Aug 29, 2014 2:06 am
by eascards
So now the whole feature works as long as the default book is still selected. For some reason, the popup that displays the _id doesn't necessarily show the correct id. It only shows the id of the default book selected even if something else is selected.
These are my settings for the LSV:
This is the mapping that I use to get the id to the label:
More Detail on using the select menu
Posted: Fri Aug 29, 2014 3:32 am
by Yurii Orishchuk
Eascards,
Here is what you have to do:
1 Set following mapping: http://prntscr.com/4hjbhq/direct
2 On select change - set "bookid" with selected item value. http://prntscr.com/4hj8c4/direct
3 In list/query service mapping link "bookid" to where parameter: http://prntscr.com/4hj8rd/direct
4 Click Edit js and paste following code: http://prntscr.com/4hja0r/direct
pre
var whereObject = {"Book": value};
return JSON.stringify(whereObject);
/pre
I've fixed this. Currently it should work.
But note you have strange link in your DB by book name. "Book" stores name currently. But it good way to store there "_id" instead.
Regards.
More Detail on using the select menu
Posted: Sun Sep 07, 2014 8:39 pm
by eascards
I just noticed that this doesn't search based on what is entered into the search input bar. If I click the search button without entering any text, it lists everything within the book that was saved in local storage. I need both. Any advise?
More Detail on using the select menu
Posted: Mon Sep 08, 2014 2:55 am
by Yurii Orishchuk
Hi,
In this case you need to combine conditions with "$and" or "$or" clause(depends on logic you need).
Please read more about it here: http://devcenter.appery.io/documentat...
Regards.
More Detail on using the select menu
Posted: Mon Sep 08, 2014 3:03 am
by eascards
I believe I would need $and but I'm afraid I don't understand the description. This is the code that is shown:
curl -X GET
-H "X-Appery-Database-Id: 526fdbd8e4b07c3286b537f1"
-G --data-urlencode 'where={"$and": [{"priority": "Low"},{"taskName": "Check email"}]}'
https://api.appery.io/1/db/collection...
That is nothing like what I have so I am having trouble matching my app with this one to make the required changes. Since it is so different, I feel like I am going to mess it up.
More Detail on using the select menu
Posted: Mon Sep 08, 2014 3:10 am
by Yurii Orishchuk
Just add to your "whereObject" "$and" clause like:
pre
var whereObject = {$and: [ "Book": value, "someOtherField" : "otherValue" ] };
return JSON.stringify(whereObject);
/pre
Regards.
More Detail on using the select menu
Posted: Mon Sep 08, 2014 3:14 am
by eascards
If I do it like this, there are a bunch of errors?
More Detail on using the select menu
Posted: Mon Sep 08, 2014 10:53 am
by Evgene Karachevtsev
Hello Eascards,
You don't correcctly set the query. It should look something like this
pre{"$and": [{"priority": "Low"},{"taskName": "Check email"}]}/pre
i.e. in the array must be objects.
More Detail on using the select menu
Posted: Mon Sep 08, 2014 12:51 pm
by eascards
I don't know what all of that means to try to make the changes in accordance to my app.
More Detail on using the select menu
Posted: Tue Sep 09, 2014 2:04 am
by Yurii Orishchuk
Hi Escards,
Please use this code instead of wrong one:
pre
var whereObject = {$and: [ {"Book": value}, {"someOtherField" : "otherValue"} ] };
return JSON.stringify(whereObject);
/pre
Regards.