Hey Awesome People, I am trying out all the possibilities of AppSheet and was wondering if anyone had any experience in creating a user favorites table ?
That is, I would like an app user to be able to click a button on a list to add the item to a favorites list.
Any guidance would be very gratefully received.
Many thanks in advance. Ian
Hi Ian, I have an idea about a way you could go about doing this: 1) Create a Yes/No column in the table called โfavoriteโ with an initial value of โfalseโ 2) Create an action called โFavoriteโ with the effect of โData: set the value of a columnโ that sets โfavoriteโ to true 3) Create a slice of the table with a row filter condition โ[favorite]โ 4) Create a view for that slice called โFavoritesโ Hope this helps!
I think the problem in @Vivian_Nowka-Keaneโs approach (if I understood it correctly) is that all users will share the same favorites list.
Each row in the favorites table should contain the original item key, and the userโs email (assuming your app requires sign in). You want to protect this table with a security filter like USEREMAIL() = [email_column_name]. This way each user will see only his favorite items and also only his email address (!). Now you can create a slice for the items table filtering only items that appear in the favorites table.
This is great advice, Am I am able to implement and test this in pre-deployment mode with my own email address ?
@Ian_Coldwell Yes, you should be able to build and test it before deploying.
Hi Gill, I have been trying to add this action to my app but still need a little quidanceโฆ I have created a table called โfavoritesโ. I have created a slice called โmy_favoritesโ. I have added an โAdd to my Favoritesโ action button the the detail view of the main list. So far so good ! My question is I canโt seem to find the way to tell the action button to add the row ( columns item key and USEREMAIL)to create a new row in the favorites table. Can you elaborate a little more about how to configure the action ?
Many many thanks โฆ I feel like I am close
@Ian_Coldwell You can set the action to go to another view in this app, and use LINKTOFORM to navigate to the right form and pre fill the the column item key. If you set the USEREMAIL to be the initial value of the email column, the user will only have to click save in that form.
Hi Ian, If you have a Yes/No column called โfavoritesโ and a slice called โmy_favoritesโ and you filter with an expression like
โAND(USEREMAIL()=[email_col], [favorite_col])โ, then a separate โfavoritesโ table isnโt necessary. If youโre looking to add a row that is initially set to be a favorite, then you can create an โAdd favoriteโ action that links to a form with pre-filled in values like Gil was saying.
To do this, youโll need to create a ref view of type form for that table.
The expression for the action of type โApp: go to another view within this appโ would look something like LINKTOFORM(โFormNameโ, โtrueโ, [favorite], USEREMAIL(), [email_col], UNIQUEID(), [key_col])
User | Count |
---|---|
41 | |
27 | |
27 | |
20 | |
13 |