MobileServiceTable.insert function

Inserts data from the supplied JSON object into the table.

mobileServiceTable.insert(instance);

Parameters

  • instance
    Type: object
The instance to insert into the table.

Return Value

Type: A Promise object that returns a new instance of the inserted object when it completes.

Call the done method on the returned Promise object to get a copy of the inserted object and handle any errors.

Example

This code inserts a new item into the table in the mobile service, and adds the returned item to the local collection.

todoTable.insert(todoItem).done(function (item) {
    todoItems.push(item);
});

.NET Framework Equivalent

InsertAsync

Requirements

Namespace

WindowsAzure.MobileServices

Library

MobileServices.js

See Also

Reference

MobileServiceTable object

Other Resources

Get started with data in Mobile Services
How to use an HTML/JavaScript client for Azure Mobile Services