Creating Code For Simplicity but Logic For Need
This article describes some operations available for Collection Data Sources. In my previous article we saw how easy it is to add a Collection Data Source to our app. A Collection Data Source offers us the following capabilities:
In the rest of the article we will see how to perform the preceding operations without writing any code.
Adding data row
A Collection Data Source is merely a table. A table consisting of rows and columns. Each column defines an attribute related to our Data Source. Each row in the table defines the value of those attributes. In any table we generally have a fixed number of columns but a large number of rows. In a Collection Data Source we can have a maximum of 40 rows (at least in a beta version). After 40 rows you need to use a new Data Source. Now to add a new Data Source:
Your new row is created. To create more rows, just repeat the preceding steps 2 to 4.
Editing data row
Sometimes it is necessary to edit a row because of some mistake or typo. This is the same as an update operation. To do the data update or to edit data:
Deleting the row
To completely remove any row from the table:
You can also make an entire table vacant in just one click, To remove all the rows:
Consider a case in which you have created your Data Source for book management and forgot to add an “author email” column. Later after filling in the database the requirement arises that it is a mandatory field. So now the challenge is on! You can’t add the column in your Data Source if it has some established data bindings. Your schema will be shown as read only if it has some established bindings or it has some rows added already. So the pont of the preceding example is, design your Data Source carefully before you start populating it.
To add a column in a newly added Data Source:
A maximum of 20 columns are possible in one table.
You can also delete columns from a Data Source.
In this article we learned about some operations that are available in a Collection Data Source. In my next article we will see how to import data from and export data to a Data Source. Finally, don’t forget to comment and share this article. In the case of any doubt feel free to ask in the comment section.