# How to import xml2js in an Evaluate Flow block

**URL:** <https://community.postman.com/t/how-to-import-xml2js-in-an-evaluate-flow-block/67736>\
**Category:** Help Hub\
**Tags:** flows, postman-flows, evaluate-block\
**Created:** [August 30, 2024, 3:38pm UTC](https://community.postman.com/t/how-to-import-xml2js-in-an-evaluate-flow-block/67736 "2024-08-30T15:38:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![posting-for-fun](https://avatars.discourse-cdn.com/v4/letter/p/59ef9b/32.png) [@posting-for-fun](https://community.postman.com/u/posting-for-fun)\
**Post date:** [August 30, 2024, 3:38pm UTC](https://community.postman.com/t/how-to-import-xml2js-in-an-evaluate-flow-block/67736/1 "2024-08-30T15:38:54Z")

</div>

Though asked, it has never been answered.  
Can you do an import/require in an Evaluate Flow block to use xml2js?

In a post-response script, I can use  
const xml2js = require(‘xml2js’);

In the Evaluate block it errors. I’ve tried  
let xml2js = import(‘xml2js’);

but that does not seem to work. There is no error, but once I reference xml2js.parseString, there is an error about the function.

---

<div class="post-metadata">

**Author:** ![lunar-module-1](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/lunar-module-1/32/26132_2.png) [@lunar-module-1](https://community.postman.com/u/lunar-module-1)\
**Post date:** [August 30, 2024, 4:53pm UTC](https://community.postman.com/t/how-to-import-xml2js-in-an-evaluate-flow-block/67736/2 "2024-08-30T16:53:00Z")

</div>

import and require are not supported today in evaluate blocks. We’re considering this for the future.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [September 2, 2024, 4:53pm UTC](https://community.postman.com/t/how-to-import-xml2js-in-an-evaluate-flow-block/67736/3 "2024-09-02T16:53:20Z")

</div>

Closed on September 2, 2024, 4:53pm UTC

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
