# How to retrieve data from odata response?

**URL:** <https://community.postman.com/t/how-to-retrieve-data-from-odata-response/11025>\
**Category:** Help Hub\
**Created:** [February 26, 2020, 11:52am UTC](https://community.postman.com/t/how-to-retrieve-data-from-odata-response/11025 "2020-02-26T11:52:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Venkat.batchu81](https://avatars.discourse-cdn.com/v4/letter/v/3ab097/32.png) [@Venkat.batchu81](https://community.postman.com/u/Venkat.batchu81)\
**Post date:** [February 26, 2020, 11:52am UTC](https://community.postman.com/t/how-to-retrieve-data-from-odata-response/11025/1 "2020-02-26T11:52:20Z")

</div>

Thanks, everyone.

My odata response is in the form of (XML) below structure

![image](https://us1.discourse-cdn.com/getpostman/original/3X/8/3/83ec39d43af1d0f5c77a6358ebc3487cdbdb7ead.png)

I am able to fetch the data till content (jsonObject.feed.entry[1].content) , but I am not able to retrieve values specific to field1 in this case, could someone help here?

---

<div class="post-metadata">

**Author:** ![john-paul](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/john-paul/32/919_2.png) [@john-paul](https://community.postman.com/u/john-paul)\
**Post date:** [February 26, 2020, 11:12pm UTC](https://community.postman.com/t/how-to-retrieve-data-from-odata-response/11025/2 "2020-02-26T23:12:04Z")

</div>

Hi @Venkat.batchu81!

Have you considered using xml2js to access the properties?

```auto
// import xml2js
let xml2js = require('xml2js');
// get xml
let xml = pm.response.text();
// prep json variable
let json;

// parse xml and store in json variable
xml2js.parseString(xml, function (err, result) {
    json = result;
});

// do whatever you need with the json
console.log(json);

```
