# Ordering / Searching in a RG according to a nested Data

**URL:** <https://forum.bubble.io/t/ordering-searching-in-a-rg-according-to-a-nested-data/340741>\
**Category:** App Organization\
**Created:** [September 25, 2024, 4:41pm UTC](https://forum.bubble.io/t/ordering-searching-in-a-rg-according-to-a-nested-data/340741 "2024-09-25T16:41:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![arielcimax](https://avatars.discourse-cdn.com/v4/letter/a/e9bcb4/32.png) [@arielcimax](https://forum.bubble.io/u/arielcimax)\
**Post date:** [September 25, 2024, 4:41pm UTC](https://forum.bubble.io/t/ordering-searching-in-a-rg-according-to-a-nested-data/340741/1 "2024-09-25T16:41:08Z")

</div>

Hi ! My question is how to approach the Repeating Group sorting or search but according to a type that is nested inside the RG Data.

For example:

I have the data type **Booking** defined with the following types  
Check-in: date  
Check-Out: date  
**User** : User  
**Room** : Room

Now what I need to do is to sort the RG “ **Bookings** ” but according to the type “RoomNr” which is inside **Room** , or according to the “User-Name” which is a type inside **User**.

Any ideas ?

Many thanks

---

<div class="post-metadata">

**Author:** ![tunacardak](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/tunacardak/32/230212_2.png) [@tunacardak](https://forum.bubble.io/u/tunacardak)\
**Post date:** [September 25, 2024, 7:02pm UTC](https://forum.bubble.io/t/ordering-searching-in-a-rg-according-to-a-nested-data/340741/2 "2024-09-25T19:02:54Z")

</div>

I think the easiest way is that writing room number to booking.

Check-in: date  
Check-Out: date  
**User** : User  
**Room** : Room  
roomnumber: number

Writing the same data twice is not the best idea but sometimes we need this kind of alternative ways.

---

<div class="post-metadata">

**Author:** ![arielcimax](https://avatars.discourse-cdn.com/v4/letter/a/e9bcb4/32.png) [@arielcimax](https://forum.bubble.io/u/arielcimax)\
**Post date:** [September 26, 2024, 8:16am UTC](https://forum.bubble.io/t/ordering-searching-in-a-rg-according-to-a-nested-data/340741/3 "2024-09-26T08:16:57Z")

</div>

Hey @tunacardak ! Thanks for your comments. I also evaluated that possibility, and even though it could be a good alternative for some Data Types, there are others that are more likely to be modified in time and that could be messy.

I also evaluated to have different RG one with Booking, other with User and show/hide them according to the filter applied. But even this alternative still sounds too messy . . . .
