# How to sort a Repeating Group with a nested field value

**URL:** <https://forum.bubble.io/t/how-to-sort-a-repeating-group-with-a-nested-field-value/118918>\
**Category:** Database\
**Created:** [October 31, 2020, 11:49pm UTC](https://forum.bubble.io/t/how-to-sort-a-repeating-group-with-a-nested-field-value/118918 "2020-10-31T23:49:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![GuyRoss](https://avatars.discourse-cdn.com/v4/letter/g/a698b9/32.png) [@GuyRoss](https://forum.bubble.io/u/GuyRoss)\
**Post date:** [October 31, 2020, 11:49pm UTC](https://forum.bubble.io/t/how-to-sort-a-repeating-group-with-a-nested-field-value/118918/1 "2020-10-31T23:49:16Z")

</div>

Hey guys,

I’ve seen this question asked many times:

How do I sort a repeating group of Type A with a field from nested object of Type B?

Or, to expound:  
I have a repeating group of type A (e.g POSTS to this forum)  
and I want to sort by a field from type B (e.g. the age of the USER who posted the POST)  
As USERs are contained in a separate table from POSTS, the AGE field is not available in the normal sort options.

Here is a simple solution:

Make a REPEATING GROUP A with

- Type of Content set to USER
- Content Source set to:  
Search for POSTS (your-posts-search-parameters) : 's USERS : Unique Elements : Sort by AGE

Inside place REPEATING GROUP B with

- Type of Content set to POST
- Content Source set to:  
Search for POSTS (your-posts-search-parameters _and_ USER is CURRENT CELL’s USER) :

I hope this explanation is clear and useful!
