How to display a list of things horizontally inside a repeating group cell

Hi all,

I am struggling to figure out how to display a list of things horizontally inside a repeating group cell.

Below I have a repeating group of which the datatype is Country. Inside the repeating group cell I have a Group which holds the Country icon, name and another repeating group listing all the Cities linked to the current cell’s Country. I can display the cities horizontally but when setting minimum width of column (currently set to 100), it creates a gap too big. I can’t possibly set a smaller number as the width of the city could be wider than this. I’d also like to separate each city name either with a comma , or a forward slash / .For this I have set the Separato to none. But not sure how to proceed. Would appreciate any help here.

image
As shown above, the 2 cities have a large gap. And i’m not sure how to separate the 2 with a comma , or a forward slash / and avoid the Bubble native Separato.

@adamhholmes @mikeloc any help here would be very much appreciated :slight_smile:

No need to use a repeating group for the cities… just a text element will do.

So get rid of the RG (cities) and just add a text element instead, set to show the current cell’s country’s cities: each item’s name (the default way to display a list of texts in Bubble is with a comma separating them, so no need to add any additional formatting).

2 Likes

Thank you! Works perfectly.

@adamhholmes One last question :slight_smile: can we change the comma that separates each item with any other character? A slash, dash or anything else?

Yes, but you need to use a different method to do that…

In your text element add the expression for the current cell’s country’s cities, then use the :format as text expression

Then, in the top box, set the list item to display to be ‘This City’s name’, and in the bottom box set the delimiter as a slash, dash, or whatever you want it to be.

Thank you @adamhholmes for the time you take answering these questions. Every solution you so kindly provide will go a long way in newbies like me realizing the full potential of Bubble!

1 Like

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