Hide button state is not persistent

Hi,

New to bubble, but noticing some limitations.
I have two buttons yes and no, if the user presses yes then no disappears.
I use the hide element for this, however, when I refresh the page, the no reappears,
(and vice-versa) is there a way to ensure that when I press the yes button, the no button disappears and when the user returns or refreshes the page, the new state with no ‘no’ button just a yes is preserved?

Please help as I have tried changing states, adding actions, using yes, no status in database, toggling and states, but none of these approaches have solved the problem.

Best wishes,

Kean

Hi keanld1,

welcome to bubble,

you can follow these instructions i made yesterday for another user.

Basically when you click the button “yes” you change the URL parameter to e.g. button=yes
Then on the no button have the condition only show it when URL does not contain button=yes).
Therefore refreshing will work. Not however, visiting the site the next day.

Alternatively, for a more permanent change, add a new field in the database to the type user e.g. “has accepted cookies?” a yes/no field.
When the button is clicked use the action: Make changes to current user: set has accepted cookies to yes.
Then only show things if current user’s has accepted cookies is no? You said you have tried this and it didnt work: what was your approach?

hope this helps
regards
Julius

1 Like

Where is your button?

That matters a little bit to this and what is it ultimately used to do?

One way that is easy is to

13%20AM

Uploading: Screen Shot 2019-10-19 at 1.21.34 AM.png…

Bubble uses cookies to automatically remember the user even if they are not a user that is signed up or signed in…its just the “current user”…if you want the app to remember this for a user who is signed up, just make sure they are logged in when the press the button.

You can use this for your entire app if it is for the purposes of age verification or something.

Put the custom state into a reusable header. In the reusable element create a popup where the buttons are. Then do same workflows.

Set a condition to show the popup when the current user is yes or no, whatever your choice and use case might necessitate.

Hi Julius,

Thanks for the support.

I set up an action with yes no condition, then in the workflow, i had a flow that changed the action status from no to yes, and then a condition to delete a button, so only one button remained. logic was applied to both buttons.

Best Kean

Hi Boston,

Thanks for the feedback.

my button is in a simple repeating group.

I set up an action with yes no condition, then in the workflow, i had a flow that changed the action status from no to yes, and then a condition to delete a button, so only one button remained. logic was applied to both buttons.

Best wishes,

Kean

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