Forum Academy Marketplace Showcase Pricing Features

"Like system" - Only once condition

Hello :slight_smile:
I’m trying to set up a kind of “like system”.

In a RG: two images: one main image and one heart image.

What I’d like:

  • When a user clicks on the heart image=> “+1” in the counter
  • A user can only click once in each heart

I managed the “+1” thing, but I’m stuck with the “only once condition” :-/

Any idea ??

You’ll need to record that fact that the user has liked that particular image somewhere.

Probably the best way to do it is to create a separate datatype for ‘likes’ that connects the user to the particular image/item/post etc.

Then use a conditional to only show the ‘like’ button (or only allow it to be clicked) if the user hasn’t already liked it (i.e. there isn’t a matching ‘like’ in your database’).

1 Like

Like @adamhholmes said. You will need to store the value somehow. You have multiple options, but I would suggest you have a “Liked by” with a user field (list). When the user clicks like, it would add them to the liked list. That is the simple way.

Thx, I think I understood for the « only once » condition .
Regarding the RG, it’s probably simple but I don’t know how to apply the condition only to image of the current cells and to not all.

I mean there’s one heart icon in every RG cells, but when a user clicks to one, I want him to be able to click again to other image’s like icons…

Conditionals on elements inside a repeating group cell apply on the individual cell level.

So just use it the same as you would on any other element.

Then if the condition is met in one cell it will apply the property to that cell, but other cells will not be affected.

Done ! very simple indeed :slight_smile: Thx a lot !

1 Like