# Is there any way to parse xml response in postman flows?

**URL:** <https://community.postman.com/t/is-there-any-way-to-parse-xml-response-in-postman-flows/45868>\
**Category:** Help Hub\
**Created:** [March 31, 2023, 5:09pm UTC](https://community.postman.com/t/is-there-any-way-to-parse-xml-response-in-postman-flows/45868 "2023-03-31T17:09:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![giangdo11](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/giangdo11/32/15403_2.png) [@giangdo11](https://community.postman.com/u/giangdo11)\
**Post date:** [March 31, 2023, 5:09pm UTC](https://community.postman.com/t/is-there-any-way-to-parse-xml-response-in-postman-flows/45868/1 "2023-03-31T17:09:22Z")

</div>

**Your question may already have an answer on the community forum. Please search for related topics, and then read through the [guidelines](https://community.postman.com/t/about-the-just-getting-started-category/37) before creating a new topic.**

> Here’s an outline with best practices for making your inquiry.

_My question_:  
Hi Team,  
I send the request and receive a body response as below picture.  
I want to parse the error message in the body.response but cannot.  
Is there any way to parse xml response in postman flows ?  
Please help me solve this.  
Thank you so much.

_Details (like screenshots)_:  
 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/1/6/16c4e49ea3e1b99eecaebb7271dd097ddb5d546b.png)

_How I found the problem_:

_I’ve already tried_:

---

<div class="post-metadata">

**Author:** ![s-a-g-e](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@s-a-g-e](https://community.postman.com/u/s-a-g-e)\
**Post date:** [March 31, 2023, 5:41pm UTC](https://community.postman.com/t/is-there-any-way-to-parse-xml-response-in-postman-flows/45868/2 "2023-03-31T17:41:16Z")

</div>

Hey @giangdo11, the `Send Request` block does support parsing xml responses. You might have to manually set it to XML.

 ![Screenshot 2023-03-31 at 10.39.44 AM](https://us1.discourse-cdn.com/getpostman/original/3X/8/3/83a49cf9108072c6a67fb0967d4e2b2fac10b1a4.png)

---

<div class="post-metadata">

**Author:** ![giangdo11](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/giangdo11/32/15403_2.png) [@giangdo11](https://community.postman.com/u/giangdo11)\
**Post date:** [April 1, 2023, 12:21am UTC](https://community.postman.com/t/is-there-any-way-to-parse-xml-response-in-postman-flows/45868/3 "2023-04-01T00:21:25Z")

</div>

Hi @s-a-g-e  
Thank you for your reply.  
I tried as you said but the SELECT block cannot parse XML in body.response.  
In the collections, I can convert body.response to Json then it can parse the error-message in the Tests as below:

```auto
var responseJson = xml2Json(pm.response.json().response);
if (pm.response.json().error == true) {
  pm.environment.set("error-message", responseJson["rpc-reply"]["rpc-error"]["error-message"]);
}

```

Can we run the script like that in postman flows? Or Does Postman flows support convert xml2Json as script?
