Main Table

The mainTable property defines which table the process will use to store its information, and will be the starting point to get information from other tables.

A process must always be connected to a table through the mainTable property.

When a process is initiated, a new record is created in the process main table. The data collected by the case updates such record.

Note

startsFromExistingData

When a process is initiated, it will always create a new record in the main table, except when the startsFromExistingData property is set to true, in which case, it won’t create a new record, but will ask the user to select an existing record. The process will then use and modify the data of the selected record.

By using startsFromExistingData: true, multiple cases can be connected to the same record. This is useful for creating processes that work with the same data.

Modeling the main table

After you model all the data structure for your app, the first step to model your process is to define its main table.

Let’s think on a Invite to Apply process of a Recruitment app. You have defined the following tables for the app:

Recruitment Diagram

Since this process will create a new record every time that someone starts this process, it’s not a good idea to use any of the defined tables as the mainTable for this process.

Because of this, you might want to create an additional table to use it as the process main table: invitations.

Recruitment Diagram 2

As you can see, invitations and applicants share some common fields (firstName, lastName, email), so you might want to merge them into a people table:

Recruitment Diagram 3

We can now define that the invitations table will be the main table for the Invite to Apply process.

Business Data and Process Data

If you don’t want to mix process specific data (e.g. approval information) with business data, you might also want to create main tables that only hold process related information, whereas you keep the business data in other tables.

Accessing tables data

Using the example above, and considering that the process main table is invitations, you can define the following fields for your forms:

  • invitee

  • invitedBy

  • date

  • invitee.firstName

  • invitee.lastName

  • invitee.email

Some field types like user, group, phone, address and other, define additional properties. To learn all the possible options, check the table fields documentation.

Also, you can use those fields in the process summary, or for mapping results of service tasks, etc.

summary:
  title: "Inviting {{invitee.firstName}} {{invitee.lastName}} to apply"
  subtitle: "{{invitee.email}} - {{date}}"

Next Steps

Now that you have defined the process mainTable, you can start modeling the process flow, using the constructs documented in the following pages.