Icon visible only if text is not empty

Hi all.

Really enjoying using Bubble and making good progress, but find myself stuck on a really basic thing…

In a repeating group I have a text box and an icon beside it. I would like the icon’s visible property to be true only if the accompanying text box is not empty.

There are some complexities behind it which mean it’s that specific behaviour I’m after.

Thank you!
James.

Hi , :wave:t2:

If you share a picture of the text’s data source I can help you better,

But I think that could works unchecking the visible property on the icon.

Then, in the text, please do a right click to copy the expression of it.

Then, go to your icon and in the conditional settings, add a new one. The condition will be the text’ expression that you copied, but adding at the end, “is not empty”.

Then add and check the visible property when this condition is meet.

Hope it works.

Bests,

Juan

1 Like

Hi Juan. Thank you for the reply. I’ll try to share more if I can’t do it with your advice above.

Can you just clarify what you mean by “in the text, please do a right click to copy the expression of it” please?

If you just mean the name of the text box, I’ve used that as a condition on the icon, but I only get the options “is hovered”, “is pressed”, etc. I don’t get the option “is not empty” in the list.

James.

Ah, I now see what you mean by Copy Expression. I actually leave the text value empty on load and then populate it with conditions (Condition 1: Set it as this field, Condition 2: Set it as different field - the user selects which field using a radio selection elsewhere).

Basically I want to display the icon only if the currently selected field is populated.

I just had an idea that I could perhaps have two overlapping groups - one containing the icon and text for this field and another group containing the icon and text for different field. Then have the radio hide/show the appropriate group depending on selection.

Will give that a try…

Thanks for your help.

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