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

Update field using PreProcess scripts

$
0
0

Hi @Matt_2012,

Try this way:

//check if u have a payload
if (event.request.payload) {
    //check if u have the key snapTypeID
    if (!event.request.payload.snapTypeID) {
        throw 'snapTypeID cannot be empty';
    } else {
        //we have the key, so change it
        event.request.payload.snapTypeID = 2;
    }
}

I hope it helps


Viewing all articles
Browse latest Browse all 5028

Trending Articles