# XML to JSON conversion endeavor

**URL:** <https://community.postman.com/t/xml-to-json-conversion-endeavor/15106>\
**Category:** Help Hub\
**Tags:** json, xml-parsing\
**Created:** [August 18, 2020, 1:19pm UTC](https://community.postman.com/t/xml-to-json-conversion-endeavor/15106 "2020-08-18T13:19:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cgreene](https://avatars.discourse-cdn.com/v4/letter/c/ccd318/32.png) [@cgreene](https://community.postman.com/u/cgreene)\
**Post date:** [August 18, 2020, 1:19pm UTC](https://community.postman.com/t/xml-to-json-conversion-endeavor/15106/1 "2020-08-18T13:19:29Z")

</div>

Hi,  
I cannot seem to attach an image to this topic, so I’ll paste in the code. I have the following test script inserted into the TESTS box:

const xml2js = require(‘xml2js’);  
xml2js.parseString(pm.response.text(), function (err, result) {  
console.log(result);  
});

The endeavor is to convert the xml payload to json. I’m using a URL with query string and API\_DoQuery with parameters to pull limited data from a Quick Base app. I get the following xml:

\<?xml version="1.0" ?\> API\_DoQuery 0 No error Tickets Main work area 280097 tbure@place.com Sales Reporting Resolved #Kroger City 1521835719739 

The objective is to use the test script to produce JSON notation. Can someone tell me what I’m doing wrong, or what additional things I should do to produce JSON?

thanks,  
cgreene

---

<div class="post-metadata">

**Author:** ![cgreene](https://avatars.discourse-cdn.com/v4/letter/c/ccd318/32.png) [@cgreene](https://community.postman.com/u/cgreene)\
**Post date:** [August 19, 2020, 2:39pm UTC](https://community.postman.com/t/xml-to-json-conversion-endeavor/15106/2 "2020-08-19T14:39:34Z")

</div>

To Moderator: please delete this post. I’m newbie to apis and this post concerning the QB API coversion to JSON is not in following with Postman capabilities. Please delete my posts.
