# HTTp Response body trim

**URL:** <https://community.linx.software/community/t/http-response-body-trim/528>\
**Category:** Uncategorized\
**Created:** [March 19, 2021, 11:37pm UTC](https://community.linx.software/community/t/http-response-body-trim/528 "2021-03-19T23:37:49Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ronan](https://community.linx.software/community/user_avatar/community.linx.software/ronan/32/433_2.png) [@ronan](https://community.linx.software/community/u/ronan)\
**Post date:** [March 20, 2021, 5:31am UTC](https://community.linx.software/community/t/http-response-body-trim/528/2 "2021-03-20T05:31:07Z")

</div>

Hi Uche,

So when working with response, import the whole JSON response as a custom type, then set the Output type property to this new custom type. To access a nested list, you will need to loop through the parent-level list in the response output first and then extract the nested list by either assigning the nested-list directly to another List type or by using the ForEach and then for each nested item use an AddToList to add each item to a main list.

Take a look at [this article](https://community.linx.software/community/t/getting-started-part-2-working-with-lists/512) and just do a search for ‘nested lists’.

Just to give you an example here, if I have response object like below:

```auto

{
   "field1":"This is a value",
   "field2":1111,
   "parentList":[
      [
         "List1_item1",
         "List1_item2",
         "List1_item3"
      ],
      [
         "List2_item1",
         "List2_item2",
         "List2_item3"
      ]
   ]
}

```

And now I want to access the nested items i.e. `List1_item1, List2_item2....`

So first I would import the whole json as a new type, lets say ‘myResponse’:  
 ![image](https://community.linx.software/community/uploads/default/original/2X/3/35c874ee4f0ab777cd91d57a26a6f7081e9bf53b.png)

I could then use a JsonReader to use the response as the **Json string** property and the newly imported type as the **Output type** :  
 ![image](https://community.linx.software/community/uploads/default/original/2X/e/eb31cdb90d54672709b78d7faa24b74616b90b75.png)

Now lets say we wanted build up a ‘master’ list of all the items in all the nested lists.

To do that, we need to first loop through the parent list, which is done by using a ForEach function and looping through the nested list returned from the JsonReader output:  
 ![image](https://community.linx.software/community/uploads/default/original/2X/1/120d1cb760c0fa71753676cc8392a507c77f415b.png)

Now for each parent list, we then need to do another loop through the child list and then we will have access to the individual items:  
 ![image](https://community.linx.software/community/uploads/default/original/2X/e/e7e6ebda859c78f516056b31165ef2a9476aa262.png)

In this lowest level loop, we will have access to the items of the nested list, so we can for example add them to a main list of some kind:

![image](https://community.linx.software/community/uploads/default/original/2X/f/f8b78db37ae8a8930dfe45eb58b92e43f7a5d457.png)

 ![image](https://community.linx.software/community/uploads/default/original/2X/5/5fdc9ec487f824c61fa11c6c9887934c3c38a3f2.png)

So depending on what you want your end result to be the exact approach may vary.

Just reply to this if you still struggle.

---

_[View the full topic](https://community.linx.software/community/t/http-response-body-trim/528)._
