# Repeater inside repeater is not supported, but suggested solution (table) does not work.

**URL:** <https://forum.wixstudio.com/t/repeater-inside-repeater-is-not-supported-but-suggested-solution-table-does-not-work/25361>\
**Category:** Ask the community\
**Tags:** code, question\
**Created:** [February 21, 2020, 3:46pm UTC](https://forum.wixstudio.com/t/repeater-inside-repeater-is-not-supported-but-suggested-solution-table-does-not-work/25361 "2020-02-21T15:46:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![polkaset](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/polkaset/32/16578_2.png) [@polkaset](https://forum.wixstudio.com/u/polkaset)\
**Post date:** [February 21, 2020, 3:46pm UTC](https://forum.wixstudio.com/t/repeater-inside-repeater-is-not-supported-but-suggested-solution-table-does-not-work/25361/1 "2020-02-21T15:46:04Z")

</div>

I am trying to do something I think should be possible, but I cannot find any way to do it. Since a picture is worth a thousand words, I’ve included a diagram of what I’m trying to do.

The orange box is a repeater. Each item in the repeater is linked to a dataset for table (called Red, here), column price. The purple box is where my troubles start. I need to map a 1:n relationship. Each row in Table green has 1 price. Table Red price can exist on many Green’s.

What I really want is to create my own repeater inside a repeater. But…according to Wix documentation, you can’t put a repeater in a repeater. It is suggested to use a table instead.

I want to display two columns in Green:

1. item
2. Special instructions.

Not all items in Green have special instructions. (in fact MOST don’t. only a few do). If I put them in a second column in a table, it looks TERRIBLE. Most of the page is empty/wasted space.

I want special instructions, if they exist, to be aligned underneath “Item”.

The problem with tables is that their formatting is REALLY limited. For example, text in different columns can’t look different. All columns have the same font/size/etc. Even if it could work for me to put “special instructions” into another column, and make the font much smaller, I can’t do that.

Another option might be to create a derived field from Green.item and Green.special\_instructions. Something like concat “item \n instructions”. I’d probably need to concatenate and create html…something like this:

item

special instructions

and then create custom CSS to style each div.

Maybe I could generate a single HTML string with the query for ALL Green items in group Red, and then I wouldn’t need a repeater inside a repeater. I could just display the string (if I can display the rendered HTML)

Is this possible? Is this my only option? If so, what is the typical way to create derived columns? Using hooks? Can you use a derived column as a column in a table? Can that derived column have custom formatting? Can it be HTML instead of just plain text?

This all seems hacky…

If someone has a better idea, I’d love to hear it.

Thank you

 ![](https://us1.discourse-cdn.com/wix/original/3X/e/9/e9bd368e8d819b08df938e313685f03616359b48.png)

---

<div class="post-metadata">

**Author:** ![allu112apina](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/allu112apina/32/13119_2.png) [@allu112apina](https://forum.wixstudio.com/u/allu112apina)\
**Post date:** [February 22, 2020, 10:59pm UTC](https://forum.wixstudio.com/t/repeater-inside-repeater-is-not-supported-but-suggested-solution-table-does-not-work/25361/2 "2020-02-22T22:59:02Z")

</div>

You can have 1 database, and 2 datasets. With the right filters:

 ![](https://us1.discourse-cdn.com/wix/original/3X/a/6/a609ea9627d62371a1282bee7c76d8814cd1114d.png)

And the 50 category is done similarly to this, just replace filter to 50

How it looks from database:

 ![](https://us1.discourse-cdn.com/wix/original/3X/e/2/e20d3dfdc204b1d75f3d3b676751fb26c7261635.png)

Is this what you are looking for?

---

<div class="post-metadata">

**Author:** ![polkaset](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/polkaset/32/16578_2.png) [@polkaset](https://forum.wixstudio.com/u/polkaset)\
**Post date:** [February 23, 2020, 2:46am UTC](https://forum.wixstudio.com/t/repeater-inside-repeater-is-not-supported-but-suggested-solution-table-does-not-work/25361/3 "2020-02-23T02:46:12Z")

</div>

So…If I understand you…you’re suggesting to use one dataset for item…filtered by price. So I don’t actually use a repeater for the price category. I manage it by hand. I make several boxes, each mapped to a different data set filtered by the price group for that box.

In my example, the orange box is a repeater, repeating on price\_group.

In your example, the orange box is…just a box. And I have to make as many orange boxes as I have prices (or price\_groups) for. I have to do this manually.

This will work in the short term, but is error prone. As soon as someone adds another price or price\_group, the UI will be missing the new price and I’ll have to add it manually.

My data looks like this:

Table: price\_group  
group1: $40: additional information for group1  
group2: $40: different additional information for group2  
group3: $50:   
group4: $50: additional information for group4  
group5: $60:

Table: item  
item1: name of item1: price\_group1:   
item2: name of item2: price\_group1: additional information for item2  
item3: name of item3: price\_group2:   
item4: name of item4: price\_group3: additional information for item4  
item5: name of item5: price\_group4: additional information for item5  
item6: name of item6: price\_group\_5: \<no additional information

I expect to see a repeater for each price group, containing the items for each group…so:

repeater of price\_group: first box (orange box above)

group1: $40: additional information for group1  
(my desire is to have another repeater here, or a table that doesn’t suck)  
item1: name of item1  
item2: name of item2: additional information for item2

group2: $40: different additional information for group2  
(my desire is to have another repeater here, or a table that doesn’t suck)  
item3: name of item3

…

In your solution, you are effectively doing a GROUP BY price, so you’d have one box for $40 (even though there are two price groups who happen to have the same price of $40…but they have different additional information)

I would have 2 boxes that both have the price of $40. I am not doing a GROUP BY. I am just doing…er…in SQL talk…JOIN price\_group ON price\_group.id WHERE item.price\_group.id = price\_group.id.

Your solution works…only sort of…and for only right now…It makes putting special price\_group instructions more difficult…It also breaks the moment someone adds a group with a new price, or change an existing price.

Dear Wix…PLEASE…either let me put a repeater inside a repeater, or let me have more control over table formatting.  
If you can’t give me nested repeaters, then I want the ability to do this:

$item\_name

$item\_additional\_information

Then in CSS (pseudo code):  
class item\_name {  
font-size: 10pt;  
}  
class item\_additional\_information {  
font-size: 8pt;  
font-style: italic;  
}

Then if I were getting even fancier, I would probably do some JS DOM magic to detect a null value for item\_additional\_information and set display:none so it doesn’t make blank space.

---

<div class="post-metadata">

**Author:** ![allu112apina](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/allu112apina/32/13119_2.png) [@allu112apina](https://forum.wixstudio.com/u/allu112apina)\
**Post date:** [February 23, 2020, 8:10pm UTC](https://forum.wixstudio.com/t/repeater-inside-repeater-is-not-supported-but-suggested-solution-table-does-not-work/25361/4 "2020-02-23T20:10:40Z")

</div>

You are talking about it looking horrible, when there is blank space, when it doesn’t show the special instructions (if there are not any)

There is few ways I know that can be used:

1. Making the #text box so narrow, that when it has more info to show, it will be shown in the next line, (if not additional text present, then not)

2. Making the items have #additionaltext, but collapsed, and by code, you check whether it is null, or not, whether to expand the additional text.

- 

And I dont get why it is hard to manage:

You can make a admin page for managing, where you set repeater Read & Write, so you can change settings you want to change. Also see the settings you want to see.
