Hide and show icon on click

Hi everybody,
I am trying to get some icons hide when clicked if shown, or shown when clicked if hidden.

I cannot find how to do it in workflow.
Any ideas?

Use state, as in don’t show normally unless state visible = true, and then on click create a workflow to change the state.

Thanks! where can one find states?
I want the visibility of the icon saved for when I run the app again, can it be done with this?

If you want it saved just make a data type something like visible yes/no connected to that cell type. Then make a workflow to change that cell.

When you do the workflow just make sure you have 2 of them. One if is Visible is No then change it to Yes, if Visible is Yes then change it to No.

Ok, I made the icons to show according to a yes/no data type, and also made to show or hide on click.
What I cannot do is to save the state in the database.
How can I save the state according to its cells index of the repeating group?
(It does not show me an option for current cell’s index)

I’m on a mission to keep people from wasting time doing multiple workflows or steps to simply invert a yes/no. You don’t have to do that. Please see:

Thanks! I will try to take a look when i have a half hour of extra time… Might be a while. I will do my best to make some time in my schedule for it though. Thanks for your time spent on this. I am sure it is probably very thorough.

1 Like

Here it is in 2 seconds then:

boolean_thing = boolean_thing is “no”

will invert boolean_thing. No need two workflows.

3 Likes

Also, if you’re doing “hide and show”, it turns out there’s actually an Action for that called “toggle”. This is one of those things that another Bubbler had to point out to me as “toggle” is kinda meaningless. But it turns out that it’s “toggle visibility”.

So the alternative if your don’t wanna track something with an extra boolean (though there are some good reasons to do so), is:

On some_condition > Element > toggle that element

this flip-flops its visibility. The first tip is completely undocumented. The second one is super easy to miss. (Because the documentation on that is THIS gem: https://bubble.io/reference#Actions.ToggleElement).

:roll_eyes:

1 Like

Keith, thank you! it works now

1 Like

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