I can't seem to figure out how to pass parameters to azure mobile services using the html/javascript client.
I want to insert in a table, with parameters.
client = new WindowsAzure.MobileServiceClient('https://<myappid>.azure-mobile.net/', 'APPKEY');
client.getTable('myTable').insert(myJsonObj, { myParam: true });
if my insert code looks like
function insert(item, user, request) {
if(request.parameters.myparam) {
// do stuff
}
}
How do I set the parameters variable in request through the html/javascript mobile client? I've found examples with the WP8 SDK it has a .withparameters function, and this question outlines how to do it for a read, Passing Query Parameters from HTML/JS App to Azure Server Script and then the most promising is http://blogs.msdn.com/b/writingdata_services/archive/2013/01/02/mobile-services-custom-parameters-in-windows-store-apps.aspx but the javascript only applies to the Windows store javascript library.
Thanks!
EDIT: So turns out my code was correct and there was an environment issue not pushing the new JS files #noobMistake
anyway passing parameters on an insert can be done in the Azure mobile services library by passing them in after the initial object.
client.getTable('myTable').insert(myJsonObj, <PARAMS HERE>);
they will be set to the parameters variable in the request object server side!