Forum Academy Marketplace Showcase Pricing Features

Hide review submission based condition

Hi all,

I have a review submission section that I want to hide IF:

Current_user has already left a review

My current condition looks like

But it’s not working. I’m sure that I’m doing something wrong.

Hi @nunesr

It should be working… :thinking:

Did you checked your privacy rules?

Other way to do it is to do your search using the current user as a constraint in your search. And in the end you check if the result of the search is zero. What means that there is no review from the current user.

@rpetribu I thought privacy rules wouldn’t be a problem here since the condition right now is just to hide the user’s ability to leave a review because they already left one.

How would you write the constraint from the current user’s view?

I tried this, but still no luck.
image

Your privacy rules are important as you are doing a search in your database…

What is the issue?

  1. The element stays invisible? Or…
  2. The element turn visible for users that already submitted a review?

The desired effect that I’m looking for is (assuming the user is logged in):

  1. If a user has left a review, the “leave a review” box should collapse
  2. If a user has not left a review, the “leave a review” box should be displayed

At the moment, this is what I have:

Current privacy rules

I’m trying to hide and collapse the following group:

That group has the following type of content:

With this layout:

And this condition:
image

Currently, the “leave a review” box is showing up regardless of whether I’ve left a review or not.

Page example: https://learntomarket.bubbleapps.io/version-test/single-course/1660330444829x520165642739624800?debug_mode=true

Thanks again for your help.

In your first post you was doing a Search.

image

Just add a constraint: Creator = Current User

And end the formula like this:

Search for reviews:count is 0

Try this! :+1:

PS: Are you from Brazil? :thinking:

Thanks for the suggestion.

I tried that, but it still doesn’t work.

This setup hides the review box regardless of whether current_user has left a review.

If I change the logic to Search for Reviews:count > 0 it shows the review regardless of whether current_user left a review.

p.s. I’m Luso Canadian :grinning:

Ok. So as I suspected, Bubble, for some reason, is not finding the user, or the reviews…

Create a text to display how many reviews the current user have.
Just place a text element in your editor and copy and paste the code I suggested as this element’s text…

Search for reviews:count

1 Like

I already had text on the page and it’s showing up correctly.

Do you mind to open you editor so I can check what is going on?
Make it visible for everyone. Just for 5 minutes.

1 Like

I just fixed it lol

I copied what I did at the top of the page and then I had to add another constraint course = This Group’s Course

Thanks so much for your help with this @rpetribu

1 Like