# Modifying post response

**URL:** <https://community.dreamfactory.com/t/modifying-post-response/807>\
**Category:** Server-Side Scripting\
**Created:** [February 2, 2015, 7:00pm UTC](https://community.dreamfactory.com/t/modifying-post-response/807 "2015-02-02T19:00:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![prasadmasina](https://avatars.discourse-cdn.com/v4/letter/p/a3d4f5/32.png) [@prasadmasina](https://community.dreamfactory.com/u/prasadmasina)\
**Post date:** [February 2, 2015, 7:00pm UTC](https://community.dreamfactory.com/t/modifying-post-response/807/1 "2015-02-02T19:00:15Z")

</div>

By default DSP responds to a successful POST request with { “id”: '1" }. I need to modify this response so it sends back the full object plus some calculated value. It seems that I should be able to use the server-side scripting put.post\_process event. it is working for get but not post. Is there way I can alter response?  
if (event.response.record) {  
\_.each(event.response.record, function(record) {  
// add a calculated field  
record[“tid”]=“1234”;  
}  
);  
}

---

<div class="post-metadata">

**Author:** ![toddappleton](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/toddappleton/32/159_2.png) [@toddappleton](https://community.dreamfactory.com/u/toddappleton)\
**Post date:** [February 2, 2015, 9:22pm UTC](https://community.dreamfactory.com/t/modifying-post-response/807/2 "2015-02-02T21:22:30Z")

</div>

If you POST a single record you’ll get back a single record (no ‘record’ array wrapper).

If you POST an array of records you’ll get back an array which is what your script is expecting.

I recommend always creating with the array format even it’s a single record.

---

<div class="post-metadata">

**Author:** ![jmontes](https://avatars.discourse-cdn.com/v4/letter/j/ee7513/32.png) [@jmontes](https://community.dreamfactory.com/u/jmontes)\
**Post date:** [February 16, 2016, 8:48pm UTC](https://community.dreamfactory.com/t/modifying-post-response/807/3 "2016-02-16T20:48:04Z")

</div>

Hi

its $event[“response”][“content”][“resource”]  
writable in post Process Event Scripts ???

I need to change POST RESPONSE

Regards
