Page 1 of 1

User specific collections

Posted: Wed Apr 03, 2013 4:35 am
by Christine Stringfield

I have a collection called "Items". I want the items to be user specific, so that when a user logs into the app, they only see their own items. How do I assign items to a user?


User specific collections

Posted: Wed Apr 03, 2013 7:15 am
by Kateryna Grynko

Hi Christine,

To store collection items for each user separately you would need to create "userId" column in collection and save there ID of user that created the Item. To get the user items you can use search in collection by column "userId".


User specific collections

Posted: Wed Apr 03, 2013 3:25 pm
by Christine Stringfield

Ok, I had done that, but I was having trouble getting the display to only display the user specific items. Instead it just displays all items in my "Items" collection. Should I be using an items_query_service for this purpose? I have the username in local storage, but can't figure out how to pass this into the "where" clause of the request parameters.

If I type "where={"username": "tim"} under the request parameter name, that works fine, but how do I pass in a variable instead of "tim" when I set up the mapping? It appears you can map to the request value. Am I supposed to update the request name that holds "where" or the request value with Javascript?


User specific collections

Posted: Wed Apr 03, 2013 3:47 pm
by Christine Stringfield

Oh, nevermind, I got the Javascript figured out! Thanks!