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?
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?
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".
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?
Oh, nevermind, I got the Javascript figured out! Thanks!