Button acting as a visibility condition to 2 containers

Hello guys, I’m not sure if it’s possible. But can I add a visibility condition to 2 containers ?

I mean I have 2 variables (containers) in a detail page, I wonder if I can filter it to only show one at a time if the button is pressed. It’s a male and female thing.

So wether the male button is pressed, only the male container will appear. Vice versa.

You can store a variable in the row that is either male or female then only show the male container if it says male and vice versa.

Then either a choice component on the detail page with options male or female or a two buttons that use the set column action to set the variable in the row.

Let me know if that made sense, if not or you have further questions I can mock this up fairly quickly.

2 Likes

Hey, Evan. Many thanks!! Ill definitely try that out and will be back.

I think I need help hahaha would be glad if you could send the mock here.

Have you set up a user-specific column to store the choice as Evan said? Where are you stuck at the moment?

Hello, I have created 2 columns. The first one is “content” and the second is “gender”. I’ve added 2 rows, one male and the other female. That’s it. I’ve tried to add the choice component, but when I try to create the bond, it substitutes the content of the first column to “male” or “female”, it depends on which one I click.

Edit 1.: pictures


Edit 2.: I rather use button blocks than the choice box

Hello, you can check this forum post about conditional select/choice.

1 Like

You need to write the selected choice to it’s own column. Preferably a user specific column. You don’t want it to write to a column that uses for something else.

You can use a button block. Set the action on each button to a Set Column action and have it write the appropriate value to a column in the table.

Once you have the selected choice written to a table, then you can use that value to control visibilty of a container.

1 Like

Hey! I recorded a video explaining the setup process of this.

Hope this helps, feel free to ask questions.

3 Likes

That was great, (edit.: unfortunately the problem wasn’t solved :confused: ! Thank you very much Evan.

What is happening is: my 1st column is not user based, so the 1st row of the column is male and the 2nd female, but they are not pre-stablished anywhere, just gramatically. It’s just content.

I did everything you thought me through the video, great tutorial btw, the containers do change, but the content inside is only male (so, 1st row only) on both containers.

I’m doing something wrong.

I suspected this issue would pop up. The problem is that your screen is attach to a single row but you are trying to display two rows. Instead of two containers, I would recommend a custom collection designed to look like your containers, but instead of setting visibility, you would set a filter on the collection to display the row that matches your choice.

Same concept overall, but replace the containers with a single custom collection, and instead of a visibility condition, set a filter on the collection.

1 Like

I see, that makes sense, thank you. Do you mean I will not be able to use button blocks? Only in-app filters?

1 Like

I did it guys, basically I combined Evan’s and Jeff’s tips.

I still used the button block.

What I did was: It’s a one row table with 2 columns - 1st is “content”, 2nd is “gender”.
On the page, I did what Jeff said and created a custom collection, designed to be a container (with no action). And a button block following Evan’s tutorial, but what I did differently, I guess, was that I set to change two different values, which were content and gender. So everytime it changes, both change.

Thank you all

1 Like

I see what you did! Awesome work, enjoy!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.