# Modify postman response with C#

**URL:** <https://community.postman.com/t/modify-postman-response-with-c/20357>\
**Category:** Help Hub\
**Created:** [February 12, 2021, 2:57pm UTC](https://community.postman.com/t/modify-postman-response-with-c/20357 "2021-02-12T14:57:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dobbedanny](https://avatars.discourse-cdn.com/v4/letter/d/dec6dc/32.png) [@dobbedanny](https://community.postman.com/u/dobbedanny)\
**Post date:** [February 12, 2021, 2:57pm UTC](https://community.postman.com/t/modify-postman-response-with-c/20357/1 "2021-02-12T14:57:26Z")

</div>

Hello everyone. I want to be able to use some C# code in postman. like splitting a csv response and adding it to a workbook. Is this possible? Thanks in advance

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [February 12, 2021, 3:43pm UTC](https://community.postman.com/t/modify-postman-response-with-c/20357/2 "2021-02-12T15:43:54Z")

</div>

That’s not possible within the Postman platform.

The only language that can be used to do things like that in the sandbox environment is JavaScript.

---

<div class="post-metadata">

**Author:** ![dobbedanny](https://avatars.discourse-cdn.com/v4/letter/d/dec6dc/32.png) [@dobbedanny](https://community.postman.com/u/dobbedanny)\
**Post date:** [February 12, 2021, 3:47pm UTC](https://community.postman.com/t/modify-postman-response-with-c/20357/3 "2021-02-12T15:47:26Z")

</div>

I had another idea. I want to set a environment variable to a csv response. right now im doing this

```auto
var data = JSON.stringify(responseBody);
postman.setEnvironmentVariable("data", data);

```

But this isn’t working. and if it work it sets the name of the variable to the entire response body. what am i doing wrong

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [February 12, 2021, 5:08pm UTC](https://community.postman.com/t/modify-postman-response-with-c/20357/4 "2021-02-12T17:08:25Z")

</div>

This would work and add the whole response, if it’s JSON, to a variable called `response`:

```auto
let jsonData = pm.response.json();
pm.environment.set("response", jsonData); 

```

If you need a specific part of the JSON response then you would need to make a reference to it.
