# SQL Record pre-processing not saving records

**URL:** <https://community.dreamfactory.com/t/sql-record-pre-processing-not-saving-records/4936>\
**Category:** Server-Side Scripting\
**Created:** [June 10, 2019, 7:33pm UTC](https://community.dreamfactory.com/t/sql-record-pre-processing-not-saving-records/4936 "2019-06-10T19:33:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![damion](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/damion/32/1074_2.png) [@damion](https://community.dreamfactory.com/u/damion)\
**Post date:** [June 10, 2019, 7:33pm UTC](https://community.dreamfactory.com/t/sql-record-pre-processing-not-saving-records/4936/1 "2019-06-10T19:33:17Z")

</div>

```
var lodash = require("lodash");

if (event.request.payload.resource) {
    lodash._.each(event.request.payload.resource, function( record ) {
        record.user_name = platform.session.user.name;
        console.log(record.user_name);
    });
}

```

The script I am using currently. I know it executes the script and even changes the record.user\_name. But it is not saved in database. What could be the issue.

 ![26%20AM](https://canada1.discourse-cdn.com/flex035/uploads/dreamfactory/original/2X/b/b72f941e725656ae7a8b5be9e29420ca590d78b9.png)
