ONEWEB provides easy access to data from its UX/ UI components. This section explains the procedure to access data using Smart Form and Page.
There are two ways to access the database from a page created using the page designer.
Integrating with Microflow.
Using Local database only for mobile application
Access Database from Page using Microflow. Microflow provides a database node for accessing data from the database. You can configure the connection type and the command for interacting with DB like insert, update, select or delete data.
After preparing Microflow, Integrate Page with Microflow. Read the steps from Page Integration with Microflow. Once the page is integrated, it can interact with the database through microflow.
Access Database from Page using Local Database option The following example shows how to query data from the local database to show on the screen.
First, create the table on the local database and prepare data. Read the steps to create a table from the Local database. (You can link the local database to database server to sync the data from server to local database)
Go to the page where you want to display this data. Select PageContent level and then configure the action to query data as shown in the image below.
Save the page and use Play me to see the results.
App Designer provides you with built-in connectors to access the database. Users can configure the data source and schema in the Datasource Configuration screen.
The user can then choose to set this data source at the entity configuration
Once the entity is linked to a data source, the user can then proceed to map the different modules to the tables in that schema and then map the fields to the columns. All the CRUD operations to the database will be managed by ONEWEB.
Select the table to be mapped in Module Configuration
Select the column name that you want to map to save the data and also search data for "Name"
Enable the property SearchCriteria for fields that you want to use as Search Criteria and enable ShowSearch for fields that you want to see as a result of searching.
To enable table search, add Buttons to trigger Search Action Drag and drop the Entity button and select ENTITY_SEARCH for page action & searchResult() for button action.
Box (1) shows the SearchCriteria and box (2) shows the ShowSearch
To enable Insert and Update of the table add Buttons to trigger Save Action Drag and drop the Entity button and select saveEntity() as button action. The other options available are saveDraftEntity() to save and return to the same screen i.e. within the open entity and saveEntityCommit() to save the transaction with commit
select ENTITY_INSERT as page action for insert page (create new)
select ENTITY_UPDATE as page action for update page (update existing)
Now go to the element on the page which displays this dataset. Click to open Connect to Data Panel on the parent object. Select Datasource as Database and choose the table that you configured on the action flow before.
Click to open Connect to Data Panel on the child object. Select Datasource Database, enable Data from a parent, and select the appropriate Data field.
To map module to a table Click on the edit icon to open the module configuration screen
To map field to a column of that table Click on the edit icon to open Field Configuration for the text field "Name"