Before you create a database based app on read this

In creating a mobile app based on back-end data in, server code that accesses a collection can be used as shown here.

In this post we start with a collection we created by importing a CSV file, FFD.csv.

We now create a Server Side script to access this collection.

In the platform  click on Server Code tab to open the user interface as shown.  In the script editor there may be some default code. Remove this script.


From the Snippets side click and add Retrieve all Objects. This inserts a line of code into the editor as shown below:

var result = Collection.query("dbId", "collectionName"); 

You need to insert correct values for the arguments. The JsonTest was the database in which the imported collection was saved. The imported CSV file was named as a collection with the name 'Custo'. The dbId parameter was found from the Settings tab for the JsonTest database


If the script is properly formulated you could Run the script. If there are errors you would see it in Trace info.


After the first line of code click return for a new line. In the Script Editor add another line of code to appear below the first line. For this choose the snippet, responseSuccess.

This inserts this code:

Apperyio.response.success({"param1":"value1"}, "application/json");

Modify this code as shown below:

Apperyio.response.success(result, "application/json");

Click Save.


Click Save and Run. You should the response to the script in the panel as show below.


Post a Comment

Popular posts from this blog

Develop a Side Menu App using Intel XDK - Part 1

Setting up Kid's Corner on Windows 10 Phone

Intel XDK: Controls 6: Using the Google Map Widget