Can I copy paste conditions from a button to another?

Hello again, everyone!

Is there anything I can do to copy paste the conditions i’ve set for a button to another one on another page?

These are the rules
image

and if I try to copy paste, I’m always getting this:
image

I still need to write this at least 20 times more

If you copy/paste all those radio buttons + the element you have this conditional on, it should keep the references

It didn’t work, unfortunately.

This is what I got when I tried that:

Very strange, I don’t think this will help but maybe copy with workflows, and paste with workflows will do something different. You could also try putting them all in a group and just copy/pasting the group on the other page

I’ll try that. Thank you friend

Copying and pasting the group:

image

lol

Yea now that really doesn’t make sense… That might at least help you just change each one from there instead of the red error text one. There’s reusable elements but might not work for your app if the buttons need to be spread around your page

Hi there, @thales.rodrigues… I happened to see your first post, so I know what you are trying to accomplish. There are plenty of ways you can do what you are trying to do (the way you are showing being one of them), but for what it’s worth, you could turn the condition you are showing into the following condition by using one custom state and four workflow events.

Now, I don’t want to muddy the waters here, so I will stop at this point, and if you are interested in learning more about this suggestion, you can let me know.

Best…
Mike

2 Likes

I most certain would like to learn more about it!

As I said on my first post, I’m really new to this and don’t know exactly what are and how does one build those custom states and workflow events (at least the names don’t click for me)

Cool… but before I get into the explanation, let me start by saying Bubble’s learning curve is steep. So, if you haven’t done the lessons or taken advantage of any of the other great learning resources that are out there, you could find yourself struggling on your Bubble journey. Anyway, just food for thought there, and now on to the explanation.

I made the example I am about to show on my index page, and I started by creating a custom state on the page that looks like this.

I already posted a screenshot of the condition on the submit button, but what I didn’t show is that the This element isn’t clickable checkbox is checked on the button’s Appearance tab.

Next, go to your Workflow tab and create a workflow event using this option.

event

Then, select RadioButton A as the element, and add a step to the event that looks like this.

That step clears the custom state’s value any time RadioButton A’s value is changed. The next step in the workflow will set the now cleared custom state’s value to the list of numbers that have been selected across all of the radio buttons, and that step looks like this.

Finally, right-click on the workflow event, copy it, paste it three times, and change RadioButton A to one of the other three radio buttons so that there ends up being a workflow event for each radio button.

One key piece of the puzzle that makes this suggestion work is that Bubble doesn’t allow a list to have duplicate values in it. So, if a user has selected the same value for two or more of the radio buttons, that value will only be added to the custom state list one time, and therefore, the count of that list will never be 4 (which means the condition to make the button clickable will never be met).

Anyway, that might be a lot more than you wanted on this post, but I hope it isn’t too overwhelming, and I hope it helps you get down a good path.

2 Likes

Thank you so much for taking the time to help me. I followed all the first part, but when get to that Value field, I can’t use the parentheses

I don’t know if I made a mistake before that step, but, unfortunately is not working.

You need to enable the experimental parentheses feature.

Thank you for the explanation, @mikeloc!

It worked perfectly!!

You have no idea how much you’ve helped me with your posts. I’m honestly in love with this community!

1 Like