Conditional Matching by email not working :(

Hi.
I am following Bubble’s beginner “Recipe App” tutorial from their youtube channel. The profile page lists information about the user and all the recipes the user has submitted.

I have an “EDIT PROFILE” button on the user’s profile page, that needs to be displayed only when the visitor is the same user as the profile page user.

I tried the conditional to display the button when “Current user’s email = Current page’s user’s email”. (Current Page’s user is the owner of that profile).

It works fine if I am logged in as another user, but the button shows up for users that are not logged in. Is this a bug or am I doing something wrong?

The same approach works perfectly if I choose to display it when “Current user’s Unique ID = Current Page user’s Unique ID”.

Any help would be appreciated.
P.S. I have “Visible on Page load” in the appearance tab turned off already.

Can you add another condition?

Add a new condition to make the element invisible if current User is not logged in

1 Like

Thank you ifeoma. That works. However, I’m still confused as to why the email matching condition didn’t work for non-logged-in users? If a user is not logged in, the email matching condition should’ve returned a “false”. Isn’t that how the logic works in Bubble, or am I missing something? :slight_smile:

If this makes sense, what you are trying to do is access the property of an object whose value is null. For non logged in users, “Current User” is null or does not exist.

1 Like

Thank you. That makes sense. :slight_smile:

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