Quantcast
Channel: DreamFactory Forum - Latest posts
Viewing all articles
Browse latest Browse all 5028

Update field using PreProcess scripts

$
0
0

I want to modify a field in a preprocess script but it is not working.

The script is

if (event.request.payload.resource) {

    lodash._.each (event.request.payload.resource, function( record ) {
        
    record.snapTypeID = 2;

However that is never run because
event.request.payload.resource is null.

when i log:

var_dump(event.request.payload);
var_dump(event.request.payload.resource);

I get for (event.request.payload):

object(Object)#2016481607 (2) {
["title"] =>
string(4) "ssss"
["description"] =>
NULL
}

and for (event.request.payload.resource):

NULL


Viewing all articles
Browse latest Browse all 5028