Skip to Navigation | Skip to Content

Docs

Basic Data Manipulation

The ProtoDB

To use this tutorial, download and open this module.


This tutorial shows you how to store information into and read information out from Proto’s lightweight database. It covers both the ProtoDB Reader and ProtoDB Writer basic modules.

The Viewer

The Builder

A Proto Database is a lightweight DB that allows you to store and reuse information in all of the applications you build in Proto. There are two modules that you will need to use to utilize a Proto DB: the ProtoDB Reader and ProtoDB Writer. Similar to the Excel Reader and Excel Writer, you must point both to a valid Proto DB that you have access to for your application to work correctly. Go to the Builder and open the property panel for the DB Writer.




You can either select from one of the databases you have access to or create a new one.

New or Old

It is important to note that when you create a new database, you should make sure to select “Public” next to the accessibility option. Otherwise, if you try to open the module from another computer on your repository, it will not be able to use the database and your application will error. Below is the window you will see if you press the "Create New Database" button in the Property Panel.

Public

If you want to read your database contents into Proto, you also have to select the database in the property panel of the ProtoDB Reader.




Note that the “Receive Update Notifications” checkbox is selected. This option updates the data coming out from the ProtoDB Reader whenever the database contents are changed. If you do not have this checked, you can only update the contents being read in by sending data to the “Do Refresh” input of the ProtoDB Reader. Receiving Update Notifications automatically can be very useful if you are working on a repository that is on a shared network drive. That way, if someone else changes the DB you are working with, you will know about their changes right after they are made.

One important module that has not yet been discussed is the Entryset Module. The Entryset Module generally takes in an entryset and allows you to output the information in different ways. You can extract any specific row or cell data from an entryset as well as transpose a selected entry or get all of the attribute names from an incoming entryset. You can also find an entryset’s size (number of entries) using the Entryset Module and build an entry from several UI components. It is the latter that we are using it for in this tutorial. The different form elements are combined into one entry of our DB using the Entryset Module as shown below:



The Entryset Module has a nice feature that allows you to set its contents to a blank Entryset with the same Attributes as a ProtoDB you select. This makes it convenient to build a ProtoDB entry using UI elements (this is what has been done in this module). To make use of this feature, open the property panel of an Entryset Module and choose "Define Entryset Structure."

Define Eset Structure

This will pop-up the following window.

Import DB Structure

After selecting "Import from ProtoDB..." you can select the ProtoDB you want from the window that pops up. Then press "OK" and the structure of the Entryset Module will be the same as that of the ProtoDB you choose.

DB Window

Go back to the builder and look at the data coming out of the Entryset Module by right clicking on the connection, selecting the specific connection, and clicking View Data. Note that the Entryset Module has combined all of the data from the UI elements into one Entry to be stored in the ProtoDB.



If you look at how the various inputs are connected to the ProtoDB Writer, you will see that there are three options for entryset input (insert, update, and delete).



We almost never deal with delete and therefore urge you not to use it when you first start building. For almost all intents and purposes, the update feature covers delete’s functionality. You will use the insert option if you want to simply add an entry to the database’s contents. The update option is useful when you change the DB data you read into Proto and want the DB to update its contents to reflect the changes you have made. This is outlined by going to the Viewer and changing some of the contents in the Table and pressing the “Update Entryset” button. Notice that in order to make any changes to the DB, you must send a value into one of its “Trigger Connectors” inputs. This is usually done with a Button as is demonstrated in this tutorial.

 
Already using Proto? Log In | Register