Forum Academy Marketplace Showcase Pricing Features

How to save info if button was clicked?

Hi,

I have button with 2 side. First side is A, second is B
image
image

I would like to have in database deafult vale 0 or “no” if button is on side A, and when user click the button A will be hidden and in database should be value 1 or “yes”. When cilck on side B in database value will be update to value 0/“No”.

My workflow for now look like these:
image

Can someone help me with these?

Hey Lukas.
Go like this:
Start Edit Workflow → Make changes to thing (when this button is pressed)
Come back to the element.
Go to conditional:
When Do a search for (exampleDBvalue) is no, this element is visible/this element isn’t clickable.

Thanks Ali

Hi Ali,

In Workflow I cant choose “when this button is pressed”
I have only these
image

Why do you want this in the database??

One reason would be “to have this button pressed shared with all users, like, to check who pressed it first in a game of 5 people”

But besides that, I don’t see a reason, maybe for your needs you don’t need to deal with database

I need to write this information because if user clicks on the side ‘A’ and logs out, it should see page B after logging in again

It’s better for you to create a condition in your elements:

When user isn’t logged in → visible

When user is logged in → not visible

Hi there, @lukas5892… maybe an example would help here, so I made one that does what you described. For this example, I added a yes/no field to the User data type called button clicked, and the default value for the field is no.

When Button A is clicked, a workflow makes changes to the current user, and the change it makes is to set the user’s button clicked field to yes.

When Button B is clicked, the workflow sets the field back to no.

Then, make sure the buttons are not visible on page load (uncheck the setting on the Layout tab), and then add conditionals to the buttons that look like this.

Button B’s condition would end with is “yes”, of course.

Anyway, if I understood your post correctly, what I am showing should do the trick, and I hope this helps.

Best…
Mike

no, that’s not what it is about.

Both sides of button is visible for logged user. All user will see the A side, when the user click button he will see B side → then loggout → login again → the user should see the side of the button, with before logging out