# Datatable with multiple rows to json

**URL:** <https://forum.uipath.com/t/datatable-with-multiple-rows-to-json/468725>\
**Category:** Studio\
**Tags:** activities-panel, question, studio, webapi, activities\
**Created:** [August 29, 2022, 10:00am UTC](https://forum.uipath.com/t/datatable-with-multiple-rows-to-json/468725 "2022-08-29T10:00:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![florian.tudorache](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/florian.tudorache/32/180749_2.png) [@florian.tudorache](https://forum.uipath.com/u/florian.tudorache)\
**Post date:** [August 29, 2022, 10:01am UTC](https://forum.uipath.com/t/datatable-with-multiple-rows-to-json/468725/1 "2022-08-29T10:01:00Z")

</div>

Hello everyone,

What i am trying to do is to output a data table with multiple rows in a json format that power automate can understand via a trigger.

What i was able to find via googling was jsonConvert.SerializeObject and it s outputting ( screenshot)

 ![image](https://global.discourse-cdn.com/uipath/original/4X/c/1/c/c1c611a1d583b714f40136dc79e528cbed664ada.png)  
Did you guys use this or do i have any other ways because as far as i can see this will not output the information corelated based on row.

---

<div class="post-metadata">

**Author:** ![PrankurJoshi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/prankurjoshi/32/37212_2.png) [@PrankurJoshi](https://forum.uipath.com/u/PrankurJoshi)\
**Post date:** [August 29, 2022, 10:26am UTC](https://forum.uipath.com/t/datatable-with-multiple-rows-to-json/468725/2 "2022-08-29T10:26:18Z")

</div>

HI @florian.tudorache

I did not get your question, do you mean by this JSON data you need a datatable output?

Prankur

---

<div class="post-metadata">

**Author:** ![florian.tudorache](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/florian.tudorache/32/180749_2.png) [@florian.tudorache](https://forum.uipath.com/u/florian.tudorache)\
**Post date:** [August 29, 2022, 11:00am UTC](https://forum.uipath.com/t/datatable-with-multiple-rows-to-json/468725/3 "2022-08-29T11:00:11Z")

</div>

Hey Prankur,

My question is how can i output the data table in a json format so that the columns and rows correspond?

---

<div class="post-metadata">

**Author:** ![PrankurJoshi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/prankurjoshi/32/37212_2.png) [@PrankurJoshi](https://forum.uipath.com/u/PrankurJoshi)\
**Post date:** [August 29, 2022, 11:05am UTC](https://forum.uipath.com/t/datatable-with-multiple-rows-to-json/468725/4 "2022-08-29T11:05:16Z")

</div>

Hello @florian.tudorache

I think there are a couple of ways to do it, you can try below code

```auto
DataTable dt = (DataTable)JsonConvert.DeserializeObject(json, (typeof(DataTable)));

```

Also please check this thread

> [@Convert json to Datatable](https://forum.uipath.com/t/convert-json-to-datatable/36639):
>
> { "Name": "Karan", "Adddress": "Kolkata", "Job\_Description": "Software Developer", "request": { "createdBy": "unknown", "comment": "Software", "Closure":[{ "type":"AB", "country":["India", "Pakistan"] }, { "type":"CD", "country":["India", "Pakistan"] } ] } } I want to convert this json to datatable. I am getting error when i…

Thanks,  
Prankur

---

<div class="post-metadata">

**Author:** ![Cristian\_Negulescu](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/cristian_negulescu/32/32964_2.png) [@Cristian\_Negulescu](https://forum.uipath.com/u/Cristian_Negulescu)\
**Post date:** [September 5, 2022, 6:24pm UTC](https://forum.uipath.com/t/datatable-with-multiple-rows-to-json/468725/5 "2022-09-05T18:24:16Z")

</div>

Based on all this discussion I create a video on Converting JSON to DataTable for multiple use-cases:

[![](https://global.discourse-cdn.com/uipath/original/4X/3/5/8/358fd739c5b52a83e518ecbfbdf1e37326ca83c2.jpeg "Ultimate guide for JSON to DataTable | UiPath Free Code | Multiple Use cases") ](https://www.youtube.com/watch?v=07qnWe9bf6k)

Thanks,  
Cristian
