Looking Up a Single Database Record

If you want to retrieve a single database record from a Mobile Service then you can call the MobileServiceTable lookup() method like this:

var id= 3;tasksTable.lookup(id).done(    // Success    function (result) {},    // Fail    function (err) {});

You pass the id of the record that you want to retrieve to the lookup() method. The id should be an integer and represent a primary key value.

If there is no matching record then an error is returned and the promise error function is executed.

Get Windows® 8.1 Apps with HTML5 and JavaScript Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.