SALES: 1-800-867-1380

Modify the request

Updated: February 27, 2015

In a JavaScript backend mobile service, scripts are used to modify read, insert, and update requests sent to Microsoft Azure Mobile Services before they are executed.

For example, the following insert script modifies the item being inserted by setting a createdAt timestamp property before calling execute.

function insert(item, user, request) {
    item.createdAt = new Date();

The following read script extends the requested query by adding an additional filter clause before calling execute.

function read(query, user, request) {
query.where({ archived: false });

For more information, see the Mobile Services script reference

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft