I would like to create a Favorites behavior ...

I would like to create a Favorites

behavior that bookmarks table items. Ideally there would be an action where the user could check (for example) a star icon for any item he/she would like to add to his/her list of favorites. There would be some indication that the star had been selected. Then that list could be called up at any time from some filtered slice view in the menu. I’m assuming this would be a user sign in app. Is there a most common practice for designing this feature in Appsheet apps?

You may or may not need [_THISROW] depending on where these expressions are used. You also can use a lookup method of you’re using user UID like you should be, vs user emails…

Disclaimer all this was sent from my phone…

I guess I should have +Gary Pinter added you

2 Questions come to mind. If 100 users favorite a particular item, wouldn’t it be better to have a separate Favorites table, that contains referenced Item IDs and USERMAILs? Also, would one be able to unfavorite or deselect a starred item from the table?

+Gary Pinter meh… Not in my opinion, it’s not important table worthy information… Also, I would anchor the action to a virtual column. .

What would be the purpose of anchoring to a virtual column?

youtube.com - Starred action Starred action

Ok, I get it! Thanks, man.

I’m stoked!

Boom. You make one action with an empty star, and one action with a solid star…

You add a physical column to your table called “starred” type enumlist.

The “empty starred action” when clicked concatenates the USEREMAIL with the starred column. CONCATENATE([starred], ", ", USEREMAIL()) show if condition in that action needs to check if the user is not in the list. NOT(IN(USEREMAIL(), [_THISROW].[starred]))

Then you want the filled in star to show up if they are in the list… So… That action is the opposite show if…

IN(USEREMAIL(), [_THISROW].[starred])

And the condition for this action removes their name from the list… SUBSTITUTE([_THISROW].[starred], USEREMAIL(), “”)

+Gary Pinter yep, pretty legit… An anchor column is only required in the table view. I find the deck view the most versatile…

@MultiTech_Visions you’re the man

You are the Boss. I got everything working except the expression to remove it from the list: SUBSTITUTE([_THISROW].[starred], USEREMAIL(), “”)

I tried it with and without [_THISROW]., but under set this column to this value I still get the error

“Parameter 1 of the function SUBSTITUTE is of the wrong type.” The column type is enumlist as you specified. I’m not sure what else could be wrong

Try wrapping it in a text expression…

SUBSTITUTE(TEXT([_THISROW].[starred]), USEREMAIL(), “”)

I forgot, substitution is a text expression

No it’s you who’s the man! @Grant_Stead answering this question like a boss!!

Tap tap taparoo. I was freaking great

Ok, it worked somewhat. It cleared the entire record, not just current USEREMAIL

I got it, removed the [_THISROW]. WOrks perfectly!

Thanks you guys. I’m so happy!!! Now for the slice, should I use the lookup function?

+Gary Pinter use the exact same condition for the show if in the solid star

I’m done! Thanks Grant. I hope others find your solution useful as well. I didn’t find this functionality in any of the sample apps