Rows in a table are records in their respective data models. This tutorial describes how to add rows to tables and records to a database. This data can be used in the application.

Let's use a simple table as an example. It stores a list of tasks and markings on their completion.

The table has three fields:

  1. Name — task name in the string format.
  2. Date — the day the event should happen in the date format.
  3. Done — task state in the boolean format.

Create form

To allow users to add records to the table, create the input form.

To create a form, drag input widgets onto the canvas:

  • Input (string) for the name field;
  • Date picker for the date field;
  • The done field must be equal to 0 when creating a new record, so it is set later directly in the BP.

To create a form, drag input widgets onto the canvas:

Set up the inputs

Setting the Label so that the interface display what field this is.

Setting the Name to use input inside the business process.

Setting the Label so that the interface display what field this is.  Setting the Name to use input inside the business process.

Create Business Process

Next step — setting up the business process for the New task button that will save the data from the inputs.

setting up the business process for the New task button

The business process is set to the onClick trigger.

To get the values from the inputs that were created earlier, we need the Get Properties blocks. For the name field — the InputString Get Properties block, and for the date field — the Datepicker Get Properties block.

Now set the Component ID field in the Get Properties blocks.

set the Component ID field

For each field, set the name of the corresponding inputs.

The next step is to create a record. To do this, add the Make task <span>block. All the necessary values from the Get properties blocks must be passed to the Make task.

The make block does not write data to the database, it creates the entity locally within the BP. To save the record, the Server request POST /task/ block is required.

add the Make task

The done field is set to the default value in the Make task block.

default value in the Make task

Now save the records in the database. For this, the Server request POST /task/ block is used, where a record from the Make task block is added.

Set up server request POST /task/

Video instruction:

It’s time to save and publish the project. Refresh the page to see results.

Was this article helpful?

AppMaster.io 101 Crash Course

10 modules
2 weeks

Not sure where to start? Get going with our crash course for beginners and explore AppMaster from A to Z.

Start Course
Development it’s so easy with AppMaster!

Need More Help?

Solve any issue with the help of our experts. Save time and focus on building your applications.

headphones

Contact Support

Tell us about your problem, and we’ll find you a solution.

message

Community Chat

Discuss questions with other users in our chat.

Join Community