How to make a like/unlike system?

I want to make a system where if you haven’t liked yet, you like a post, but if you have already liked it, it unlikes it. I’m trying to make it right now and it isn’t working, Please help

here’s a way of doing it: add a list of users to the post’s data type that will be the list of liked users. then add a workflow on the like button: if button is clicked, only when user is not in current post’s list of liked users, then add: make changes to, current post, list of liked users add current user. then copy and paste this workflow and change the only when condition to say: only when user is in current post’s list of liked users. and then in the make changes to post, list of liked users remove current user. hope this helps

1 Like

i tried that but whenever i clicked the like button it removed the like as soon as i liked the post

@swordsoftarchive

The solution provided by @nachodip97 is the right one

You might have this issue if you’re testing in preview with a sample:thing in the page URL
If your page is of type Post you would need to create a dummy Post in App Data and include its unique id in the page URL

Just FYI. :blush: This happens a lot. Just don’t put both steps in the same workflow. You have to copy the whole workflow and make it separate and only have the one step each. Otherwise it will run both steps. For example…

When press button:
Step 1: Like > Step 2: Unlike

Instead do this.

When press button and item is liked already:
Step 1: Unlike

When press button and item is not liked already:
Step 1: Like

Want to learn more?

www.nocodeminute.com

Presenting

I hope that helps clarify things. I don’t want to make it more confusing. :blush:

3 Likes

This topic was automatically closed after 70 days. New replies are no longer allowed.