Introduction to the Fields Table
The fields table is designed to store and manage various types of data entry fields used throughout the Serial application. This table plays a crucial role in defining the structure and behavior of data collection processes, allowing for flexible and customizable data entry experiences.Table Structure
The fields table is structured to accommodate different field types and their associated properties. Here’s a detailed breakdown of its columns:| Column Name | Data Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | Unique identifier for each field |
| company_id | uuid | not null | Foreign key referencing the companies table |
| is_optional | boolean | Indicates if the field is optional | |
| created_at | timestamp with time zone | not null | Timestamp of field creation, defaults to current time |
| type | text | not null | Type of the field (e.g., LINK, MANUAL_ENTRY, etc.) |
| prompt | text | Text prompt or question for the field | |
| group_name | text | Name of the group the field belongs to | |
| order | bigint | Order of the field within its group or process | |
| dataset_id | uuid | Foreign key referencing the datasets table | |
| method | text | Method of data collection or entry | |
| data_validation | text | Validation rules for the field data | |
| label_format_id | uuid | Foreign key referencing the label_formats table |
Usage and Functionality
The fields table is designed to be flexible and support various data collection scenarios. Here are some key points about its usage:- Field Types: The table supports multiple field types, including Link, ManualEntry, Checkbox, PassFail, Image, File, Datetime, Signature, and Label. This allows for diverse data collection methods within processes.
- Process Integration: Fields are associated with process steps and can be grouped and ordered within these steps. This enables the creation of structured data collection workflows.
-
Data Validation: The
data_validationcolumn allows for the specification of validation rules, ensuring that collected data meets specific criteria or formats. -
Customization: The
methodcolumn provides additional flexibility in how data is collected or entered for each field, allowing for customization based on specific requirements.
Notes
-
Recent changes to the table structure have removed some columns (e.g.,
config,post_process_function) and added others (method,data_validation), reflecting an evolution in the application’s approach to field management. -
The
datasetstable now handles some data that was previously stored in the fields table, such as lower and upper specification limits (lsl, usl) and units. -
Here’s an example of how field types might be used in TypeScript:
- The fields table has relationships with several other tables, including companies, process_steps, datasets, and label_formats, indicating its central role in the application’s data model.

