Skip to main content

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 NameData TypeConstraintsDescription
iduuidprimary keyUnique identifier for each field
company_iduuidnot nullForeign key referencing the companies table
is_optionalbooleanIndicates if the field is optional
created_attimestamp with time zonenot nullTimestamp of field creation, defaults to current time
typetextnot nullType of the field (e.g., LINK, MANUAL_ENTRY, etc.)
prompttextText prompt or question for the field
group_nametextName of the group the field belongs to
orderbigintOrder of the field within its group or process
dataset_iduuidForeign key referencing the datasets table
methodtextMethod of data collection or entry
data_validationtextValidation rules for the field data
label_format_iduuidForeign 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:
  1. 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.
  2. 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.
  3. Data Validation: The data_validation column allows for the specification of validation rules, ensuring that collected data meets specific criteria or formats.
  4. Customization: The method column 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 datasets table 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:
    export enum FieldType {
      Link = "LINK",
      ManualEntry = "MANUAL_ENTRY",
      Checkbox = "CHECKBOX",
      PassFail = "PASSFAIL",
      Image = "IMAGE",
      File = "FILE",
      Datetime = "DATETIME",
      Signature = "SIGNATURE",
      Label = "LABEL",
    }
    
  • 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.
By leveraging the fields table, the Serial application can create dynamic, customizable forms and data collection interfaces, enabling flexible process design and execution across various industries and use cases.