<p>I think you need to add 'object' to your syntax if you're using {{ }}:</p>

<pre><code>{{ object.tourDates.tourDate }}
</code></pre>

<p>Else it's <code>{ tourDates.tourDate }</code> I believe.</p>

<p>See the plugins <a href="https://github.com/TopShelfCraft/SuperSort" rel="nofollow noreferrer">docs</a> under Advanced sorting.</p>

CC BY-SA 3.0
2017-06-06T13:47:42.140Z
Tried both of those but neither worked.
Lettie
CC BY-SA 3.0
2017-06-06T14:13:33.677Z
Well, it may not be a perfect solution, but today I needed something similar. What I've done (suited my situation best): I fetched all entries and added all the info I needed, including a superTable field in a matrix, as attributes of an object to an array. At the end I just looped over the array and outputted all the object attributes. It was very easy to sort that array suing superSort by one of those attributes.
Tom De Smet
CC BY-SA 3.0
2017-06-06T14:21:15.633Z
You did this in twig or in a plugin?
Lettie
CC BY-SA 3.0
2017-06-06T14:37:16.290Z
I did this in Twig.
Tom De Smet
CC BY-SA 3.0
2017-06-06T13:19:15.457Z
2017-06-06T13:19:15.457Z
Tom De Smet
<p>I'm trying to use supersort to sort my entries based on date values in a supertable field.</p>

<p>This is what I have so far but it's not working.</p>

<pre><code>{% set artists = craft.entries.section('artists') %}
{% set entries = artists | supersort('sortAs', '{{ tourDates.tourDate }}') %}
</code></pre>

<p>tourDates is the supertable handle tourDate is the date field in the table. There can be multiple date entries in one table so it would need to bring them out in order as well.</p>

<p>I'm not sure this is even possible.</p>

<plugin-supertable><plugin-supersort>
Sorting SuperTable Field with SuperSort?
# Sorting SuperTable Field with SuperSort?

(Asked by: username_0 on 2017-06-06)

I'm trying to use supersort to sort my entries based on date values in a supertable field.
This is what I have so far but it's not working.
{% set artists = craft.entries.section('artists') %}
{% set entries = artists | supersort('sortAs', '{{ tourDates.tourDate }}') %}

tourDates is the supertable handle tourDate is the date field in the table. There can be multiple date entries in one table so it would need to bring them out in order as well.
I'm not sure this is even possible.

**Tags:** plugin-supertable, plugin-supersort


---

## 1 answers

### Answer by username_1 on 2017-06-06. Score: 2

I think you need to add 'object' to your syntax if you're using {{ }}:
{{ object.tourDates.tourDate }}

Else it's { tourDates.tourDate } I believe.
See the plugins docs under Advanced sorting.

> **Comments:**
> **username_0**: Tried both of those but neither worked.  
> **username_1**: Well, it may not be a perfect solution, but today I needed something similar. What I've done (suited my situation best): I fetched all entries and added all the info I needed, including a superTable field in a matrix, as attributes of an object to an array. At the end I just looped over the array and outputted all the object attributes. It was very easy to sort that array suing superSort by one of those attributes.  
> **username_0**: You did this in twig or in a plugin?  
> **username_1**: I did this in Twig.  

---

