Hello again There are a few ways to set this up, but one method is to create a new data type called “Like”. Within that data type, you can add a field called ‘Post’ which stores the Post that the User has liked. (The built-in Creator field will store the User who has created the Like for a particular Post).
In the repeating group which displays Posts, I have an upvote icon and a text element.
The text element under the icon searches the database for the total number of Likes each Post has received by all Users:
When the upvote arrow is clicked, and the User has not yet ‘liked’ that post, a new ‘Like’ entry will be created for that User and the Post they just favorited.
Event (the ‘only when’ condition here says “When the Search for Likes, for the Current Cell’s Post, Created by the Current User is 0 -->”)
Action (Create a new Like):
When the upvote arrow is clicked, and the User has already ‘liked’ that post before (they are trying to unfavorite it), the ‘Like’ already stored in the database for that Post/User will be deleted.
Event (the ‘only when’ condition here says “When the Search for Likes, for the Current Cell’s Post, Created by the Current User, is not 0 -->”):
Action (Delete the ‘Like’ in the database for the Current Cell’s Post, created by the Current User):
Last but not least! The icon and the text element both have conditional formatting statements which change the color of the text and the upvote icon to ‘blue’ when the User has Liked the Post before:
And it will remain grey when the User hasn’t liked the Post before:
In Preview Mode it looks like this:
Editor:
Preview:
And that should do it! You can also store a list of the ‘Likes’ on the Post and User data types, incase you think it may be helpful in the future to have them stored there as well. Feel free to let me know if you have any questions!