Skip to main content

Introduction to the Checkboxes Table

The checkboxes table is designed to store checkbox data for various processes within the Serial application. This table plays a crucial role in capturing boolean-type responses and potentially contributing to pass/fail criteria in process workflows.

Table Structure

The checkboxes table is structured to efficiently store and relate checkbox data to other entities in the system. Here’s a detailed breakdown of its columns:
Column NameData TypeConstraintsDescription
iduuidprimary key, not nullUnique identifier for each checkbox entry
company_iduuidforeign key, not nullReference to the associated company
process_entry_iduuidforeign key, not nullReference to the related process entry
unique_identifier_iduuidforeign key, not nullReference to the associated unique identifier
dataset_iduuidforeign key, not nullReference to the related dataset
prompttextnot nullThe text prompt or question for the checkbox
is_passbooleannullableIndicates if the checkbox contributes to a pass state
is_checkedbooleannot nullThe state of the checkbox (checked or unchecked)
created_attimestamp with time zonenot null, default now()Timestamp of when the checkbox entry was created

Usage and Functionality

The checkboxes table is designed to be a flexible and integral part of data collection within processes. Here are some key points about its usage:
  1. Process Integration: Each checkbox is associated with a specific process entry, allowing for detailed tracking of checkbox responses within the context of a particular process execution.
  2. Pass/Fail Criteria: The is_pass column can be used to determine whether a checked or unchecked state contributes to the overall pass/fail status of a process or step.
  3. Data Aggregation: By linking checkboxes to datasets and unique identifiers, the system can aggregate and analyze checkbox data across multiple processes or entities.

Notes

  • Row-level security is enabled on the checkboxes table, ensuring data privacy and access control.
  • Policies are in place to restrict insert and select operations based on the user’s associated company ID:
    create policy "Insert - Data - SameCompany"
    on "public"."checkboxes"
    as permissive
    for insert
    to authenticated
    with check ((company_id IN ( SELECT privileges.company_id
       FROM privileges
      WHERE (privileges.supabase_uid = auth.user_id()))));
    
    create policy "Select - Data - SameCompany"
    on "public"."checkboxes"
    as permissive
    for select
    to authenticated
    using ((company_id IN ( SELECT privileges.company_id
       FROM privileges
    
  • The table structure allows for efficient querying of checkbox data, enabling features like filtering process entries based on checkbox states or analyzing trends in checkbox responses over time.
By leveraging the checkboxes table, the Serial application can capture and manage boolean-type responses within processes, contributing to a flexible and powerful system for tracking and analyzing workflow data.