# Loop json dynamic content array in IONIC list

**URL:** <https://forum.ionicframework.com/t/loop-json-dynamic-content-array-in-ionic-list/119306>\
**Category:** ionic-v3\
**Created:** [January 24, 2018, 4:55pm UTC](https://forum.ionicframework.com/t/loop-json-dynamic-content-array-in-ionic-list/119306 "2018-01-24T16:55:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![karthikcp](https://avatars.discourse-cdn.com/v4/letter/k/a3d4f5/32.png) [@karthikcp](https://forum.ionicframework.com/u/karthikcp)\
**Post date:** [January 24, 2018, 4:55pm UTC](https://forum.ionicframework.com/t/loop-json-dynamic-content-array-in-ionic-list/119306/1 "2018-01-24T16:55:59Z")

</div>

I was populating my ionic list from the json response as given below:

> {  
> “engineering”: [{  
> “0”: {  
> “id”: 1,  
> “name”: “Amrita School of Engineering”  
> },  
> “location”: “Kollam”  
> },  
> {  
> “0”: {  
> “id”: 3,  
> “name”: “Amrita School of Medicine”  
> },  
> “1”: {  
> “id”: 4,  
> “name”: “Amrita School of Engineering”  
> },  
> “location”: “Kozhikode”  
> }  
> ],  
> “medicine”: [{  
> “0”: {  
> “id”: 2,  
> “name”: “Amrita School of Medicine”  
> },  
> “location”: “Kollam”  
> },  
>   
> ]  
> }  
> My Ionic list is:

```auto
<ion-list no-lines>
        <ion-list-header *ngFor="let details of searchResults?.engineering">
          <div style="background-color:#2f6b8c;padding-top:10px;padding-bottom:10px;padding-left:5px;color:white">{{details.location}}</div>
          <button ion-item *ngFor="let detail of details?.0" (click)="itemSelected(detail.id)">
              <span style="text-transform: capitalize;">{{detail.name}}</span>
          </button>  
        </ion-list-header>
      </ion-list>

```

Using this i am able to print the location object data while each location has different list. In The above JSON you can see Kollam in engineering has only one college name so ‘0’, while kozhikode in engineering has 2 colleges so 0,1. if n colleges then 0 to n array will be there… But how could i populate this in a list? Any help?

---

<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, 9:53pm UTC](https://forum.ionicframework.com/t/loop-json-dynamic-content-array-in-ionic-list/119306/2 "2021-07-19T21:53:22Z")

</div>

Closed on July 19, 2021, 9:53pm UTC


