On my users posts I am trying to create the same like button as we have below this post. If 10 people like then the number shows ten likes and the love icon remains red. Even when the next time user logs in.
Trying to think multiple ways on how to set the data structure. I was thinking of adding a field type ‘likes’ in Users and setting that as yes/no. Then on the love icon, I could put a condition saying, if the current user’s like is yes, change the color to red.
Are you just having “likes” or are you doing up/down voting ? Assuming the former …
On your post you want two fields …
And on the User you have …
So when you click like and the user doesn’t already have this thing in their like list …
Update the thing.
Update the user.
Have a conditional on the like button that changes it when the post is on the user;s like list.
You will need to think about handling what you want to do when someone “unclicks” like. Basically you want to -1 on the like count, and remove the user from the post, and the post from the user. So reverse the process.
No luck Nigel. Would you mind, if you can recreate this on the forum app. I think I am messing up the data structure. I don’t get current cell location things in my settings.
Ok, I re-read your instruction again and created as you advised. Now my issue is. I cannot see the elements in the preview. Just see a blank repeating group.
Find that strange. I thought something wrong with my app, then I created a fresh app and still the same.
@NigelG I was wondering what the “location” data type is for this. I was trying to build a similar feature for posts on an app like instagram, but I didn’t see where the location data type fits in.
Hi @NigelG or @hdavy2002 , do issues arise when more than one user hits “like” on a thing at the same time or while the workflow is still running? or is it not that big of a deal?