# Can I use "Tests/Scripts" to modify a returned message response which in turn is used to post as a subsequent call?

**URL:** <https://community.postman.com/t/can-i-use-tests-scripts-to-modify-a-returned-message-response-which-in-turn-is-used-to-post-as-a-subsequent-call/14498>\
**Category:** Help Hub\
**Created:** [July 26, 2020, 9:52pm UTC](https://community.postman.com/t/can-i-use-tests-scripts-to-modify-a-returned-message-response-which-in-turn-is-used-to-post-as-a-subsequent-call/14498 "2020-07-26T21:52:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RTam87](https://avatars.discourse-cdn.com/v4/letter/r/a5b964/32.png) [@RTam87](https://community.postman.com/u/RTam87)\
**Post date:** [July 26, 2020, 9:52pm UTC](https://community.postman.com/t/can-i-use-tests-scripts-to-modify-a-returned-message-response-which-in-turn-is-used-to-post-as-a-subsequent-call/14498/1 "2020-07-26T21:52:31Z")

</div>

Hello,  
I am using Postman as a middleman to GET from a vendor site because the vendor is still using the old DTD format and calls. I need to pass along the result to another vendor. But, this vendor uses a more modern integration and will not accept DTD.  
I am able to get responses back from that old vendor site. Since this vendor still uses the DTD format, I need to delete the first 2 lines of the response every time and add in a templated element section at the top; along with 2 new lines at the bottom to close off the new elements.  
My question is … can I use Postman’s Tests/Scripts to modify the response message automatically so that I do not have to manually update the result prior to sending it to the second vendor’s site?  
I have attached a simple snippet of what needs to be altered in the old vendor’s result file.

\*\*\*\*\*\*\*\*\* Sample of the response shown below \*\*\*\*\*\*\*\*\*

\<?xml version="1.0" encoding="ISO-8859-1"?\>

\<old\_message\_packet\>  
…  
\</old\_message\_packet\>  
\*\*\*\*\*\*\*\*\* End Sample of the response \*\*\*\*\*\*\*\*\*

\*\*\*\*\*\*\*\*\* Sample of the modifications shown below \*\*\*\*\*\*\*\*\*

\<?xml version="1.0" encoding="UTF-8"?\>

\<enhanced\_message\_packet\>  
  
…  
  
  
…  
\<old\_message\_packet\>  
…  
\</old\_message\_packet\>  
  
\</enhanced\_message\_packet\>  
\*\*\*\*\*\*\*\*\* End Sample of the modifications \*\*\*\*\*\*\*\*\*

Any help would be greatly appreciated.  
Thank you.
