How to show/hide icons in Repeating Group based on which Radio Button is used?

I made an app where my friends and I enter in what Trading Card we want to buy or sell. First, we enter in a player’s name (e.g. LeBron James) and then we select a radio button to “Buy” or “Sell”.

How do I make it so that AFTER the user clicks the “Save” button, the Repeating Group NEXT TO THE SAVE BUTTON will display a green dollar bill if the radio button “Want to Buy” has been selected?

My app is already set up so that the Player’s Name will appear in the RG. Also, how do I make sure that the red dollar bill is hidden from view if the green dollar bill is displayed? Alternately, if the radio button “Want to Sell” is selected a red dollar bill should be displayed and the green dollar bill should be hidden from view. How do I do this?

Here’s my app where anyone can edit it: Cardcollectors | Bubble Editor

Thank you!

I can hop on in a little bit to help you out.

However your data base for the cards should have a sell and buy column in the and when the radio button is hit it makes the changes to the cards status. The red and green dollar bill is just an icon with a couple conditions, first its only visible is sell or buy is yes and second is just an add on to the first.

So something like this,
Current cells card sell is yes-> this element is visible, this icon color is red. And just do another condition like this for buy.

Aha, I understand what you’re saying now. My brain didn’t make the connection that the state of the radio button needs to be stored in the database as well. I’m going to start making your suggested changes. Thank you!

I have now created a buy & sell column in my database as you suggested. It’s actually part of the TradingCard data type. So in the workflow for the “Save” button, how do I set the Buy column in the database to “yes” when the radio button called “Buy” is selected? This is a workflow that I have not seen in any tutorial videos anywhere. And I haven’t been using Bubble long enough to understand how to do this. The name of the RadioButton is “RadioButtonA”.

The logic should be: If “Buy” radio button is selected, the Buy column should be set equal to “yes” and the Sell column should be set equal to “no”. I just don’t know where in Bubble to implement this logic…Thank you.

So in bubble without the use of a plugin you can not (at least what i have figured out) save a rg cell with an element outside of the rg.

I would set the workflow on the radio buttons themselves.

Your work flow would be when element input(radio button A has changed-> make changes to thing(current cell trading card) then pick the field.
Remember that it will be a yes or no, so it would be field sell-> when radio button A is selected (or checked, I don’t recall the terminology).
If its selected it will record a yes in the database.

Be sure to set your defaults on those data types(buy and sell) in your data set as no

1 Like

Ok I tried my best to do what you described but when you look at my Workflow…the text is highlighted in “red” indicating that either what you said isn’t possible OR I didn’t properly implement what you said.

Can you look at what I did and tell me what I’m doing wrong?

Sorry for late response, I hopped in and did the changes, take a look.

1 Like

No problem! Ah, I see the DESIGN change that you made…each RG cell requires its OWN set of radio buttons. I’m fine with that change, it gets the job done. THANK YOU for taking the time to explain this to me. I never would have figured this out for myself since the Bubble interface is somewhat confusing in terms of what it can and cannot do. Thank you again!!

Yep, if you are wanting to do anything to something in a rg, the action element for what your wanting needs to be in the rg, ie. The radio buttons.

Your rg is just a custom view of your data set.

No problem for the advice, if you need something just hollar.

1 Like

Thank you twilson9034!! :grinning:

1 Like

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