# Load JSON data into a DataGrid

**URL:** <https://community.stadium.software/community/t/load-json-data-into-a-datagrid/52>\
**Category:** How To\
**Created:** [May 15, 2020, 9:44am UTC](https://community.stadium.software/community/t/load-json-data-into-a-datagrid/52 "2020-05-15T09:44:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivan\_Giordani](https://community.stadium.software/community/user_avatar/community.stadium.software/ivan_giordani/32/40_2.png) [@Ivan\_Giordani](https://community.stadium.software/community/u/Ivan_Giordani)\
**Post date:** [May 15, 2020, 9:44am UTC](https://community.stadium.software/community/t/load-json-data-into-a-datagrid/52/1 "2020-05-15T09:44:36Z")

</div>

Hi,

I’m wondering if it possible to load JSON array data into a DataGrid control or if it is possible to show the data into a tabular view.

Thank you!

Regards,  
Ivan

---

<div class="post-metadata">

**Author:** ![dawie.botes](https://community.stadium.software/community/user_avatar/community.stadium.software/dawie.botes/32/27_2.png) [@dawie.botes](https://community.stadium.software/community/u/dawie.botes)\
**Post date:** [May 15, 2020, 10:25am UTC](https://community.stadium.software/community/t/load-json-data-into-a-datagrid/52/2 "2020-05-15T10:25:20Z")

</div>

Hi Ivan,

Yes, you can. I’ll build you a sample on how to use JSON data.

Dawie

---

<div class="post-metadata">

**Author:** ![nirav.domah](https://community.stadium.software/community/user_avatar/community.stadium.software/nirav.domah/32/34_2.png) [@nirav.domah](https://community.stadium.software/community/u/nirav.domah)\
**Post date:** [May 15, 2020, 10:33am UTC](https://community.stadium.software/community/t/load-json-data-into-a-datagrid/52/3 "2020-05-15T10:33:00Z")

</div>

Hi Ivan,

You can do so by using a SetValue action and assigning the Target to DataGrid.Data and the Value to your json array.

If you have a DataGrid with the columns Column1, Column2 & Column3, the format of your json should look like:

```
[
	{'Column1': 'My data in Row1Col1', 'Column2': 'My data in Row1Col2', 'Column3': 'My data in Row1Col3'},
	{'Column1': 'My data in Row2Col1', 'Column2': 'My data in Row2Col2', 'Column3': 'My data in Row2Col3'},
	{'Column1': 'My data in Row3Col1', 'Column2': 'My data in Row3Col2', 'Column3': 'My data in Row3Col3'}
]

```

See [https://help.stadium.software/Controls/DataGrid](https://help.stadium.software/Controls/DataGrid) for more info.

Cheers,  
Nirav

---

<div class="post-metadata">

**Author:** ![dawie.botes](https://community.stadium.software/community/user_avatar/community.stadium.software/dawie.botes/32/27_2.png) [@dawie.botes](https://community.stadium.software/community/u/dawie.botes)\
**Post date:** [May 15, 2020, 11:09am UTC](https://community.stadium.software/community/t/load-json-data-into-a-datagrid/52/4 "2020-05-15T11:09:14Z")

</div>

Please find below a quick example. I’ve taken screenshots you can recreate:

I started with a new Application and added a Grid:

 ![Screenshot 2020-05-15 at 12.55.00](https://community.stadium.software/uploads/default/original/1X/cebd94f265e98b14f4bf9018fb4faecd964c0882.png)

Then, for the Grid, I defined 2 Columns, “Name” and “Phone”.

Under your StartPage.Load event:

 ![Screenshot 2020-05-15 at 12.55.09](https://community.stadium.software/uploads/default/original/1X/1caec39f7e621a4d63c2c2018fbf6014e2ac0248.png)

I got some JSON which contained a List of “name” and “phone” fields (I just assigned it straight into a Variable, but normally you would get it from a web-service.):

![Screenshot 2020-05-15 at 12.55.17](https://community.stadium.software/uploads/default/original/1X/e8d78a66fdfa82dda971982f95cb5c789823d7ef.png)

Then you assign the value to your Grid Data:

![Screenshot 2020-05-15 at 12.55.27](https://community.stadium.software/uploads/default/original/1X/3f38e066023a492bd39d56b2033486a416c86e82.png)

You need to map the data (little pencil icon on the right):

 ![Screenshot 2020-05-15 at 12.55.35](https://community.stadium.software/uploads/default/original/1X/7d7fe90310d581fd7ae04ff5572b72ebcc140cb1.png)

And done:

 ![Screenshot 2020-05-15 at 12.55.44](https://community.stadium.software/uploads/default/original/1X/f968afdb7d196a7cb63bae7351d97c5fccbcae6f.png)

---

<div class="post-metadata">

**Author:** ![dawie.botes](https://community.stadium.software/community/user_avatar/community.stadium.software/dawie.botes/32/27_2.png) [@dawie.botes](https://community.stadium.software/community/u/dawie.botes)\
**Post date:** [May 15, 2020, 11:16am UTC](https://community.stadium.software/community/t/load-json-data-into-a-datagrid/52/5 "2020-05-15T11:16:13Z")

</div>

Here’s my example solution attached:

[ShowJSON.sapz](https://community.stadium.software/community/uploads/short-url/sZlECmHCxjnv7xV16pYIA6FqXwX.sapz) (8.1 KB)

---

<div class="post-metadata">

**Author:** ![Nem](https://community.stadium.software/community/letter_avatar_proxy/v4/letter/n/85e7bf/32.png) [@Nem](https://community.stadium.software/community/u/Nem)\
**Post date:** [May 23, 2022, 3:53pm UTC](https://community.stadium.software/community/t/load-json-data-into-a-datagrid/52/6 "2022-05-23T15:53:01Z")

</div>

Hey Dawie, it would be really useful if the value fields could ‘auto-match’ to the names of the columns in the grid. This would save lots of time!

---

<div class="post-metadata">

**Author:** ![shamima](https://community.stadium.software/community/user_avatar/community.stadium.software/shamima/32/268_2.png) [@shamima](https://community.stadium.software/community/u/shamima)\
**Post date:** [May 24, 2022, 5:46am UTC](https://community.stadium.software/community/t/load-json-data-into-a-datagrid/52/7 "2022-05-24T05:46:33Z")

</div>

Hi Nem,  
please see [How to easily populate a datagrid with json data using types](https://community.stadium.software/community/t/how-to-easily-populate-a-datagrid-with-json-data-using-types/162)

We use types to help with columns mapping
