Data relationships

Data model overview

This page is your map of SafetyCulture data across Exporter, the Power BI connector, and the Data Feeds APIs. It shows how datasets relate, which keys to join on, and where to start organized into four domains: People, Work, Tasks, and Structure.

How to use this page

  1. Start with a question. Example: “Who is a member of each site?”
  2. Open the relevant domain slice. For the example: People.
  3. Use the diagram + key join callouts to build your relationships. Example joins: site_members.member_id = users.user_id, site_members.site_id = sites.site_id.
📘

Export and access methods

Use SafetyCulture Exporter for ad-hoc or scheduled bulk files, Power BI connector for direct dashboards, and Data Feeds APIs for programmatic, incremental pipelines. Review the decision guide for trade-offs.

All three access paths expose the same logical model and only the transport differs.

Domains

Domain slice

Go here for

Datasets

Primary bridges to other slices
(join keys)

People([/data/people])

Info about users, groups, memberships, or learning status.

users, groups, group_users, site_members, course_progress

  • To Structure: site_members.site_id → sites.site_id
  • To Work/Tasks: user_id on authors/owners/assignees
  • Alias note: site_members.member_id = users.user_id

Work([/data/work])

Define, plan, and analyze work (forms, schedules, inspections).

templates, inspections, inspection_items, schedules, schedule_assignees, schedule_occurrences, activity_log_events

  • To Structure: site_id on work records
  • To People: user fields (authors/owners/assignees via user_id)
  • Within Work: inspection_items.audit_id → inspections.audit_id, inspections.template_id → templates.template_id

Tasks([/data/tasks])

Track actions/issues, ownership, and timelines.

actions, action_assignees, action_timeline_items, issues, issue_timeline_items, issue_relations

  • To People: assignees user_id / group_id
  • To Work: links to work items (for example, inspection_id)
  • To Structure: site_id on actions/issues (where present)

Structure([/data/structure])

Work by location or asset.

sites (hierarchy), assets

  • From People: site_members.site_id → sites.site_id
  • From Work/Tasks: site_id on inspections, actions, and (sometimes) issues

Data diagrams per domain

📘

Legend

  • Purple box = dataset (table/feed).
  • Box with a dotted border = Link tables (many↔many bridges)
  • Cardinality (crow’s-foot)
    • ↣o (circle + crow’s-foot) = 0..* on that side (optional, many).
    • | (single bar) = exactly one (1).
    • || (double bar) = one and only one (mandatory 1).
  • Join notation: child_fkparent_pk

People ↔ Structure model (Users, Groups, Site membership)

Use these datasets to relate users/groups to sites. The link tables are group_users and site_members (alias: site_members.member_id = users.user_id).

Entities

DatasetPrimary keyPurpose
usersuser_idPeople in your organization.
groupsgroup_idCohorts for permissions/assignment.
group_users(group_id, user_id)Link table: users ↔ groups
sitessite_idLocations (often hierarchical)
site_members(site_id, member_id)Link table: users ↔ sites (member_id = users.user_id)
course_progressinternal id or course_id + user_idPer-user learning/enrollment/progress

Join cheat sheet

From (child)To (parent)ON (child_fk → parent_pk)Notes
group_usersusersuser_id → user_id
group_usersgroupsgroup_id → group_id
site_membersusersmember_id → user_idAlias
site_memberssitessite_id → site_id
course_progressusersuser_id → user_idRoll up by site via userssite_members → sites
🪄

Cross-slice pointers for orientation

  • To Work: joins typically use user_id (authors/owners/assignees) and site_id (where inspections occur).
  • To Tasks : assignee tables reference user_id/group_id; actions/issues may also carry site_id.

Work data model (Templates, Inspections, Item responses, and Template access)

This diagram shows how work is defined and executed. Templates define the work; inspections are the runs of that work; item-level responses live in inspection items; and template permissions control who can use/manage each template. Cross-domain bridges are shown to Sites (where work happens) and Users/Groups (who can access or authored the work).

Entities

DatasetPrimary keyPurpose
templatestemplate_idDefinition of work (forms).
inspectionsinspection_id or audit_idExecuted runs of a template.
inspection_items(impl PK; joins via inspection key)Item/question-level responses.
template_permissions(impl PK; joins via template_id, user_id/group_id)Access/usage rights for templates.
schedulesschedule_idPlanned work.
schedules_assigneesInternal/opaque ID or composite (varies)Per-user learning/enrollment/progress
schedules_occurrencesInternal row ID (not required for joins)Generated instances of planned work.
sitessite_idLocation context (Structure slice).
usersuser_idPeople context (People slice).
groupsgroup_idCohorts (People slice).

Join cheat sheet

From (child)To (parent)ON (child_fk → parent_pk)Notes
inspection_itemsinspectionsinspection_id → inspection_idUse canonical key (inspection_id or audit_id).
inspectionstemplatestemplate_id → template_id
inspectionssitessite_id → site_idCross-slice bridge to Structure.
inspectionsusersauthor_id → user_id (or owner_id → user_id)Choose field name used in feeds.
template_permissionstemplatestemplate_id → template_idLink table
template_permissionsusersuser_id → user_idLink table
template_permissionsgroupsgroup_id → group_idLink table
schedule_assigneesschedulesschedule_id → schedule_idLink table
schedule_assigneesusersuser_id → user_idLink table
schedule_assigneesgroupsgroup_id → group_idLink table
schedule_occurrencesschedulesschedule_id → schedule_idLink table

Tasks (Actions, Issues, assignments, and relations)

Use these datasets to model task ownership and traceability across your environment. Actions and Issues live at sites, are assigned to Users/Groups via link tables, and Issues can relate back to Inspections and Actions for end-to-end traceability.


Entities

DatasetPrimary keyPurpose
actionsaction_idRemediation/next-step tasks; can be site-scoped.
action_assigneesinternal/compositeAssigns actions to users and/or groups.
issuesReported issues/incidents; can be site-scoped.
issues_assigneesinternal/compositeAssigns issues to users and/or groups.
issue_timeline_itemsinternal row idStatus/history events for an issue.
issue_relationsinternal/compositeTraceability links: issue ↔ inspection/action.
inspectionsinspection_id (or audit_id)Referenced by issue_relations.
sitessite_idLocation context for actions and issues.
usersuser_idActors/assignees.
groupsgroup_idCohorts for assignment.

Join cheat sheet

From (child)To (parent)ON (child_fk → parent_pk)Notes
action_assigneesactionsaction_id → action_idLink table
action_assigneesusersuser_id → user_idLink table
action_assigneesgroupsgroup_id → group_idLink table
actionssitessite_id → site_idSite context
issue_assigneesissuesissue_id → idLink table
issue_assigneesusersuser_id → user_idLink table
issue_assigneesgroupsgroup_id → group_idLink table
issue_timeline_itemsissuesissue_id → idHistory of an issue
issue_relationsissuesissue_id → idTraceability root
issue_relationsinspectionsinspection_id → inspection_id (or audit_id)Keep key label consistent with Work slice
issue_relationsactionsaction_id → action_idLinks issues to actions
issuessitessite_id → site_idSite context

Structure data model (Sites and Assets)

Use the Structure slice to answer “where” things happen and to roll up all other data by location. Sites form a hierarchy (such as Region → Facility → Area). Assets are equipment/objects that usually live at a site. Other slices (Work and Tasks) reference Sites via site_id.


Entries

Dataset

Primary key

Purpose

sites

site_id

Location nodes in a hierarchy. Self-join on parent to model hierarchy.

assets

asset_id

Equipment/objects located at sites. Typically carries site_id.

(bridges from other slices; not entities of this slice)

inspections, actions, and sometimes issues each carry site_id to link back to sites.

Join cheat sheet

From (child)To (parent)ON (child_fk → parent_pk)Notes
sites (child)sites (parent)parent_site_id → site_idModels site hierarchy (root sites have NULL parent).
assetssitessite_id → site_idPlaces assets at a site.
inspections (Work)sitessite_id → site_idSome orgs allow inspections without a site; LEFT JOIN if nullable.
actions (Tasks)sitessite_id → site_idSite context for actions.