# Ionic List Group BY

**URL:** <https://forum.ionicframework.com/t/ionic-list-group-by/113431>\
**Category:** ionic-v3\
**Created:** [November 26, 2017, 3:07pm UTC](https://forum.ionicframework.com/t/ionic-list-group-by/113431 "2017-11-26T15:07:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![earnestware](https://avatars.discourse-cdn.com/v4/letter/e/87869e/32.png) [@earnestware](https://forum.ionicframework.com/u/earnestware)\
**Post date:** [November 26, 2017, 3:07pm UTC](https://forum.ionicframework.com/t/ionic-list-group-by/113431/1 "2017-11-26T15:07:38Z")

</div>

I’m struggling with group by for a list. My JSON data is an array of objects, each object is an event with a title, description and start time. I want to group by start time. The JSON below should be displayed in a list, with 1 header showing 1 item, and another header showing 2 items. I’m willing to restructure the JSON if necessary.  
The error I get is

`TypeError: undefined is not an object (evaluating '_co.item.event_title')`

The code:

```auto
<ion-list ng-repeat="(key, value) in items | groupBy: 'start_time'">
  <div class="item item-divider">
    <h1>{{key}}</h1>
  </div>
  <h3 ng-repeat="item in value">{{item.event_title}}</h3>
  	<div>
  		{{item.event_description}}
  	</div>
</ion-list>

```

JSON DATA (I’m not having any problem with the provider, I have plenty of lists working

```auto
[
	{
		"event_id": 1,
		"event_title": "Test",
		"event_description": "This is a test",
		"event_date": "2018-03-14",
		"start_time": "13:00:00",
		"end_time": "14:30:00"
	},
	{
		"event_id": 2,
		"event_title": "Test2",
		"event_description": "This is a test 2",
		"event_date": "2018-03-14",
		"start_time": "15:30:00",
		"end_time": "17:00:00"
	},
	{
		"event_id": 2,
		"event_title": "Test 3",
		"event_description": "This is a test 3",
		"event_date": "2018-03-14",
		"start_time": "15:30:00",
		"end_time": "17:00:00"
	}
]

```

---

<div class="post-metadata">

**Author:** ![danicode](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/danicode/32/127848_2.png) [@danicode](https://forum.ionicframework.com/u/danicode)\
**Post date:** [August 26, 2019, 12:50pm UTC](https://forum.ionicframework.com/t/ionic-list-group-by/113431/3 "2019-08-26T12:50:23Z")

</div>

I’ve managed to make a group by, following this tutorial: [https://robferguson.org/blog/2018/09/28/ionic-3-filtering-sorting-and-pipes/](https://robferguson.org/blog/2018/09/28/ionic-3-filtering-sorting-and-pipes/)

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 10:02pm UTC](https://forum.ionicframework.com/t/ionic-list-group-by/113431/4 "2021-07-19T22:02:12Z")

</div>

Closed on July 19, 2021, 10:02pm UTC


