# Sorting according to a Thing's Thing field

**URL:** <https://forum.bubble.io/t/sorting-according-to-a-things-thing-field/7208>\
**Category:** Idea\
**Created:** [October 22, 2016, 4:56pm UTC](https://forum.bubble.io/t/sorting-according-to-a-things-thing-field/7208 "2016-10-22T16:56:36Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicolas.daprigny](https://avatars.discourse-cdn.com/v4/letter/n/b38774/32.png) [@nicolas.daprigny](https://forum.bubble.io/u/nicolas.daprigny)\
**Post date:** [October 22, 2016, 4:56pm UTC](https://forum.bubble.io/t/sorting-according-to-a-things-thing-field/7208/1 "2016-10-22T16:56:36Z")

</div>

We can sort of list of [Product]s according to their [Category]. However which field of the [Categorie] thing is used for sorting ?

Idea 1 : When selecting [Catagory], be able to select one of its text, date or number field  
Or  
Idea 2 : Define in the Data settings the primary field used by defaut for sorting

---

<div class="post-metadata">

**Author:** ![nicolas.daprigny](https://avatars.discourse-cdn.com/v4/letter/n/b38774/32.png) [@nicolas.daprigny](https://forum.bubble.io/u/nicolas.daprigny)\
**Post date:** [December 30, 2016, 11:08am UTC](https://forum.bubble.io/t/sorting-according-to-a-things-thing-field/7208/2 "2016-12-30T11:08:17Z")

</div>

Coming back to this, letting us define “Default sorting Field” would be great. I mean :

- keeping the default sorting by creation date
- when a Thing is “sort by” another Thing, use this last defaut sorting field. So in my previous exemple, when I do a search for [Product] defined by [Category], the Category’ s **defaut sorting field** would be used to sort the products.

---

<div class="post-metadata">

**Author:** ![james.k.grover](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/james.k.grover/32/7001_2.png) [@james.k.grover](https://forum.bubble.io/u/james.k.grover)\
**Post date:** [January 11, 2017, 11:10am UTC](https://forum.bubble.io/t/sorting-according-to-a-things-thing-field/7208/3 "2017-01-11T11:10:25Z")

</div>

You can already do this with Sort by: “Dynamic Field” …then you can pick whatever you want BUT you cant reference the thing you just searched for (dumb), so instead you have to duplicate the search criteria from the main search… then it works. Seems a bit hack-ish, but does the job.

 ![](https://us1.discourse-cdn.com/bubble/original/2X/7/7bc9c051bde4ce7235248dbbf2f1d6f07d2faf65.png)

They could add “This thing” as an option to the dynamic sort field, that’d make it less confusing to set up. I think the way you originally suggested would be too big of a change for them to do, but this way should be pretty easy to add (i assume).

Generally, it’d be good if they added the “Advanced” option to ALL dynamic inputs. It’s a super useful feature of the :filtered option, coz it’s so freeing, but doesn’t seem to be available anywhere else. I’d like to see that option at the bottom of literally every dynamic input’s list of options.

---

<div class="post-metadata">

**Author:** ![hooman.haghighi69](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/hooman.haghighi69/32/9097_2.png) [@hooman.haghighi69](https://forum.bubble.io/u/hooman.haghighi69)\
**Post date:** [January 11, 2017, 11:46am UTC](https://forum.bubble.io/t/sorting-according-to-a-things-thing-field/7208/4 "2017-01-11T11:46:20Z")

</div>

very good. thanks for you tapic

---

<div class="post-metadata">

**Author:** ![nicolas.daprigny](https://avatars.discourse-cdn.com/v4/letter/n/b38774/32.png) [@nicolas.daprigny](https://forum.bubble.io/u/nicolas.daprigny)\
**Post date:** [January 11, 2017, 1:13pm UTC](https://forum.bubble.io/t/sorting-according-to-a-things-thing-field/7208/5 "2017-01-11T13:13:56Z")

</div>

Thanks.  
What you propose is doable but not data-wize. Sorting this way, loading speef would increased considerably.

---

<div class="post-metadata">

**Author:** ![james.k.grover](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/james.k.grover/32/7001_2.png) [@james.k.grover](https://forum.bubble.io/u/james.k.grover)\
**Post date:** [January 11, 2017, 1:48pm UTC](https://forum.bubble.io/t/sorting-according-to-a-things-thing-field/7208/6 "2017-01-11T13:48:30Z")

</div>

Well yeah, i suppose doing 2 searches the same would theoretically take twice as long. But actual load time… depends how it handles the searches. Unless the database is huge it should still be pretty fast… and at least a temporary workaround until they can solve properly as below.

Indeed, as i said, **the BEST way they could fix it is to add “This Thing” as an option to the dynamic sort field**. That would take away the need for the 2nd search and would perfectly solve the problem right? It shouldn’t add any processing time.

---

<div class="post-metadata">

**Author:** ![mishav](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/mishav/32/6420_2.png) [@mishav](https://forum.bubble.io/u/mishav)\
**Post date:** [January 12, 2017, 6:18pm UTC](https://forum.bubble.io/t/sorting-according-to-a-things-thing-field/7208/7 "2017-01-12T18:18:52Z")

</div>

Possibly the field chosen in Data \> App Data \> Primary fields would be used for sorting, sorry too tired to test it right now. Unfortunately it is not changeable at runtime for different sort orders.

---

<div class="post-metadata">

**Author:** ![gf\_wolfer](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/gf_wolfer/32/262456_2.png) [@gf\_wolfer](https://forum.bubble.io/u/gf_wolfer)\
**Post date:** [January 12, 2017, 6:35pm UTC](https://forum.bubble.io/t/sorting-according-to-a-things-thing-field/7208/8 "2017-01-12T18:35:07Z")

</div>

I find that if I need to reference an item or list of Data in more than one spot on a single page that it is usually best to create a group or repeating group somewhere on the page that does the search and then you can reference the group instead of performing another search. Make the group or repeating group 1x1 pixels and a clear background to not show up, as I think (can’t quite remember) that it has to be visible on page load to actually do the search

This way the search is performed only once on page load which should help with the speed

* * *

Geoff | Wolfer Tech  
Creator of [The Best Selling Bubble Template](https://001thepremiumlanding.bubbleapps.io/)  
Creator of [The Most Used Bubble Template (FREE)](https://thefreelandingpage.bubbleapps.io/)

---

<div class="post-metadata">

**Author:** ![nicolas.daprigny](https://avatars.discourse-cdn.com/v4/letter/n/b38774/32.png) [@nicolas.daprigny](https://forum.bubble.io/u/nicolas.daprigny)\
**Post date:** [January 12, 2017, 7:23pm UTC](https://forum.bubble.io/t/sorting-according-to-a-things-thing-field/7208/9 "2017-01-12T19:23:39Z")

</div>

I thought also about it. Primary fields seem use for the “app data” visualisation only.  
In the App Data \> Data, a defaut sorting field would be best. But in my app, the sorting field’s field can be different from one page to another.

---

<div class="post-metadata">

**Author:** ![vincent56](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/vincent56/32/16009_2.png) [@vincent56](https://forum.bubble.io/u/vincent56)\
**Post date:** [May 18, 2017, 8:52am UTC](https://forum.bubble.io/t/sorting-according-to-a-things-thing-field/7208/10 "2017-05-18T08:52:46Z")

</div>

Adding to this discussion, I’m wondering if it is possible to sort on a Thing’s Thing dynamically.

I put the field name in a custom state that I use to sort dynamically. This works perfectly, but only ‘1 level’ deep. If I want to reference a Thing on the Thing I reference in the RG, the sort doesn’t work. With one data type I just added another two fields with a copy of the referenced Thing’s data as text to help sort the RG but with others this won’t be that easy and it also kind of beats the point of having data across multiple data types.

How does the dynamic field sort work? It takes the name of the field but what if it is not /name but /Thing/name ?

---

<div class="post-metadata">

**Author:** ![AliFarahat](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/alifarahat/32/189604_2.png) [@AliFarahat](https://forum.bubble.io/u/AliFarahat)\
**Post date:** [October 8, 2018, 4:46pm UTC](https://forum.bubble.io/t/sorting-according-to-a-things-thing-field/7208/11 "2018-10-08T16:46:14Z")

</div>

Hello @Bubble Any updates on @vincent56 comment above? Maybe this can be a quick win!

---

<div class="post-metadata">

**Author:** ![emmanuel](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/emmanuel/32/27657_2.png) [@emmanuel](https://forum.bubble.io/u/emmanuel)\
**Post date:** [October 8, 2018, 6:16pm UTC](https://forum.bubble.io/t/sorting-according-to-a-things-thing-field/7208/12 "2018-10-08T18:16:55Z")

</div>

This is unfortunately not a quick win.

---

<div class="post-metadata">

**Author:** ![AliFarahat](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/alifarahat/32/189604_2.png) [@AliFarahat](https://forum.bubble.io/u/AliFarahat)\
**Post date:** [October 8, 2018, 6:22pm UTC](https://forum.bubble.io/t/sorting-according-to-a-things-thing-field/7208/13 "2018-10-08T18:22:14Z")

</div>

Hahaha. No prob 🤣

---

<div class="post-metadata">

**Author:** ![philippe1](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/philippe1/32/38163_2.png) [@philippe1](https://forum.bubble.io/u/philippe1)\
**Post date:** [April 9, 2020, 5:28pm UTC](https://forum.bubble.io/t/sorting-according-to-a-things-thing-field/7208/14 "2020-04-09T17:28:31Z")

</div>

> [@vincent56](#):
>
> I put the field name in a custom state that I use to sort dynamically. This works perfectly, but only ‘1 level’ deep. If I want to reference a Thing on the Thing I reference in the RG, the sort doesn’t work. With one data type I just added another two fields with a copy of the referenced Thing’s data as text to help sort the RG but with others this won’t be that easy and it also kind of beats the point of having data across multiple data types.

What about it in 2020?

---

<div class="post-metadata">

**Author:** ![julian\_digitalsilva](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/julian_digitalsilva/32/64064_2.png) [@julian\_digitalsilva](https://forum.bubble.io/u/julian_digitalsilva)\
**Post date:** [July 7, 2020, 1:14pm UTC](https://forum.bubble.io/t/sorting-according-to-a-things-thing-field/7208/15 "2020-07-07T13:14:56Z")

</div>

Bump - I need this functionality too. The ability to sort a repeating group on a thing’s thing would be super helpful.

The use case: I want my users to be able to sort their tables based on the data in related things of the thing the table consists of. At the moment, they can sort on the fields in the table that are direct fields in the thing, but not linked things.  
eg. A PurchaseOrder (thing A) has a Vendor (thing B), and I want to sort the table based on the name of the Vendor. I am not going to put a Vendor name as a text field on the purchase order, as it’s redundant and already stored in the linked Vendor thing.

---

<div class="post-metadata">

**Author:** ![philippe1](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/philippe1/32/38163_2.png) [@philippe1](https://forum.bubble.io/u/philippe1)\
**Post date:** [July 12, 2020, 4:22pm UTC](https://forum.bubble.io/t/sorting-according-to-a-things-thing-field/7208/16 "2020-07-12T16:22:29Z")

</div>

in the meantime try with nested repeaters

---

<div class="post-metadata">

**Author:** ![SerPounce](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/serpounce/32/62068_2.png) [@SerPounce](https://forum.bubble.io/u/SerPounce)\
**Post date:** [July 12, 2020, 5:17pm UTC](https://forum.bubble.io/t/sorting-according-to-a-things-thing-field/7208/17 "2020-07-12T17:17:00Z")

</div>

You can achieve this today.

> [@\[Bdk Concepts\] Livesorting in bubble](http://forum.bubble.io/t/bdk-concepts-livesorting-in-bubble/88155):
>
> Hello Bubblers, A lot of things can be achieved using a combination of [Bdk Plugins](https://www.notion.so/Bubble-Developer-Kit-Plugins-3eb057d9d81d4176b1be678856c80faf). Inspired by @SerPounce’s suggestion & feedback like [this](https://gauravbschooltest.s3.ap-south-1.amazonaws.com/Screenshot+2020-04-24+at+5.55.53+PM.png), sharing here an an example of Live sorting a RG based on a calculated metric. This example uses 0 workflow steps, doesn’t require saving anything to database, and is very fast. Click [here](https://bdkdemos.bubbleapps.io/concept_livesorting) to open bubble page Click [here](https://bubble.io/page?version=live&type=page&name=concept_livesorting&id=bdkdemos&tab=tabs-1) to open bubble editor Below is a screen recording of the demo: It makes use of 2 of the bdk plugins: [RepeatingGroup T…](https://www.notion.so/Bubble-Developer-Kit-Plugins-3eb057d9d81d4176b1be678856c80faf#74ed187ed4a44e1eab42c12cfd471ee2)

---

<div class="post-metadata">

**Author:** ![keith](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/keith/32/56020_2.png) [@keith](https://forum.bubble.io/u/keith)\
**Post date:** [July 12, 2020, 8:04pm UTC](https://forum.bubble.io/t/sorting-according-to-a-things-thing-field/7208/18 "2020-07-12T20:04:23Z")

</div>

List Sifter’s SORT action does this.

- Put List Shifter on page
- Set its “List to Shift” as the list you need to sort.
- Fire the SORT List Action at it. For “Source Sort List”, just compose the Thing’s Thing’s field.
- List Shifter’s “Shifted List” output now contains the sorted version of the list.

Example:

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/0/f/0fb6c6a96553b3921df9160c56f342b557a97fc3.png)

Here’s an explorer page demonstrating this basic use of SORT in List Shifter:

[https://list-shifter-demo.bubbleapps.io/version-test/mapped-sort-basic?debug\_mode=true](https://list-shifter-demo.bubbleapps.io/version-test/mapped-sort-basic?debug_mode=true)

And [here’s the editor](https://bubble.io/page?type=page&name=mapped-sort-basic&id=list-shifter-demo&tab=tabs-1).

---

<div class="post-metadata">

**Author:** ![julian\_digitalsilva](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/julian_digitalsilva/32/64064_2.png) [@julian\_digitalsilva](https://forum.bubble.io/u/julian_digitalsilva)\
**Post date:** [July 12, 2020, 11:16pm UTC](https://forum.bubble.io/t/sorting-according-to-a-things-thing-field/7208/19 "2020-07-12T23:16:35Z")

</div>

Thanks for the suggestions - I’m currently using DragTablePlus plugin to neatly present the tables and will see how to integrate these suggestions with the plugin

---

<div class="post-metadata">

**Author:** ![keith](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/keith/32/56020_2.png) [@keith](https://forum.bubble.io/u/keith)\
**Post date:** [July 13, 2020, 6:13am UTC](https://forum.bubble.io/t/sorting-according-to-a-things-thing-field/7208/20 "2020-07-13T06:13:43Z")

</div>

Sigh.

[Next page](https://forum.bubble.io/t/sorting-according-to-a-things-thing-field/7208.md?page=2)
