> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getparable.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Integrate and analyze your Planning Center data with Parable

## What is Planning Center?

Planning Center is a comprehensive suite of church management applications
designed to help churches organize information, coordinate events, communicate
with teams, connect with congregants, and manage their church operations.

## How Parable Approaches Planning Center Data

Parable acts as a data warehouse that integrates with Planning Center to provide
your church with unified, queryable access to all your ministry data:

1. **Syncs data** from all your Planning Center apps automatically
2. **Stores it** in a structured PostgreSQL database
3. **Provides SQL access** so you can query across all your data
4. **Maintains relationships** between different data types
5. **Keeps everything current** with regular synchronization

## Planning Center Apps in Parable

Parable integrates with all major Planning Center applications to provide
unified insights across your church data:

<CardGroup cols={2}>
  <Card title="People" icon="users">
    Your church directory and member management system
  </Card>

  <Card title="Giving" icon="hand-holding-dollar">
    Donation tracking, pledges, and financial reporting
  </Card>

  <Card title="Check-Ins" icon="clipboard-check">
    Event attendance and child safety tracking
  </Card>

  <Card title="Groups" icon="user-group">
    Small groups, classes, and ministry management
  </Card>

  <Card title="Calendar" icon="calendar">
    Events, resources, and scheduling
  </Card>

  <Card title="Services" icon="music">
    Worship planning and volunteer scheduling
  </Card>

  <Card title="Registrations" icon="clipboard-list">
    Event signups and payments
  </Card>

  <Card title="Publishing" icon="mobile">
    Media and sermon management
  </Card>
</CardGroup>

## Core Concepts

### Multi-Tenant Architecture

Every church (organization) in Parable has isolated data:

* Each table includes a `tenant_organization_id` column
* Data is automatically filtered by your organization
* You can only see your church's data

### Data Synchronization

Parable manages data synchronization behind the scenes:

```
Planning Center API → Parable Sync Engine → PostgreSQL Database → Your SQL Queries
```

<AccordionGroup>
  <Accordion title="Synchronization Details">
    * Data syncs automatically every night
    * Full sync on initial setup
    * Nightly updates thereafter
    * Handles API rate limits gracefully
    * Retries on failures automatically
  </Accordion>
</AccordionGroup>

### Database Schema Pattern

All Planning Center data follows a consistent pattern:

```sql theme={null}
-- Main entity table
planning_center.{app}_{entity}
  - {entity}_id              -- Planning Center's ID
  - tenant_organization_id   -- Your church's ID
  - system_status           -- Data lifecycle (active/transferring/stale)
  - created_at              -- When created in Planning Center
  - updated_at              -- When last updated in Planning Center
  - [entity fields]         -- The actual data fields

-- Relationship table (for connections between entities)
planning_center.{app}_{entity}_relationships
  - {entity}_id             -- Parent entity
  - relationship_type       -- Type of related entity
  - relationship_id         -- ID of related entity
```

### System Status Explained

Every record has a `system_status` field that tracks its lifecycle:

* **`transferring`** - Being imported from Planning Center
* **`active`** - Current, valid data
* **`stale`** - Marked for removal in next sync

<Note>
  Parable's row-level security automatically filters to show only `active`
  records, so you don't need to filter manually.
</Note>

## Understanding Our Storage Approach

### Why Separate Relationship Tables?

Planning Center's API returns relationships separately from main data. We mirror
this structure for several reasons:

1. **Data Integrity** - Relationships can change independently of entities
2. **Flexibility** - One entity can have multiple relationship types
3. **Performance** - Optimized indexes for different query patterns
4. **Consistency** - Same pattern across all Planning Center apps

### Example: Connecting People to Donations

Instead of a direct foreign key, we use relationship tables:

```sql theme={null}
-- Find all donations with donor information
SELECT
    d.donation_id,
    d.amount_cents / 100.0 as amount,
    p.first_name,
    p.last_name
FROM planning_center.giving_donations d
JOIN planning_center.giving_donation_relationships dr
    ON d.donation_id = dr.donation_id
    AND dr.relationship_type = 'Person'
JOIN planning_center.giving_people p
    ON dr.relationship_id = p.person_id
WHERE d.received_at >= '2024-01-01';
```

## Common Query Patterns

### Basic Entity Query

```sql theme={null}
-- Get all people
SELECT
    person_id,
    first_name,
    last_name,
    membership
FROM planning_center.people_people;
```

### Joining Through Relationships

```sql theme={null}
-- Get people with their household
SELECT
    p.first_name,
    p.last_name,
    h.name as household_name
FROM planning_center.people_people p
JOIN planning_center.people_person_relationships pr
    ON p.person_id = pr.person_id
    AND pr.relationship_type = 'Household'
JOIN planning_center.people_households h
    ON pr.relationship_id = h.household_id;
```

### Cross-Module Queries

```sql theme={null}
-- Find giving totals by group membership
SELECT
    g.name as group_name,
    COUNT(DISTINCT gm.person_id) as member_count,
    SUM(d.amount_cents) / 100.0 as total_giving
FROM planning_center.groups_groups g
JOIN planning_center.groups_memberships gm
    ON g.group_id = gm.group_id
JOIN planning_center.giving_donation_relationships dr
    ON gm.person_id = dr.relationship_id
    AND dr.relationship_type = 'Person'
JOIN planning_center.giving_donations d
    ON dr.donation_id = d.donation_id
WHERE d.received_at >= '2024-01-01'
GROUP BY g.name;
```

### Ministry Health Metrics

Combine attendance, giving, and group participation data to understand overall
engagement trends:

```sql theme={null}
-- Get weekly giving totals with donor counts
SELECT
    DATE_TRUNC('week', d.received_at) as week_start,
    COUNT(DISTINCT dr.relationship_id) as unique_donors,  -- Count unique people
    SUM(d.amount_cents) / 100.0 as total_amount          -- Convert cents to dollars
FROM planning_center.giving_donations d
JOIN planning_center.giving_donation_relationships dr
    ON d.donation_id = dr.donation_id
    AND dr.relationship_type = 'Person'                  -- Only person relationships
WHERE d.received_at >= '2024-01-01'
GROUP BY DATE_TRUNC('week', d.received_at)
ORDER BY week_start DESC;
```

## Tips for Junior Developers

<Steps>
  <Step title="Start Simple">
    Begin with basic SELECT statements on single tables:

    ```sql theme={null}
    -- Just get some data to explore
    SELECT * FROM planning_center.people_people LIMIT 10;
    ```
  </Step>

  <Step title="Use Table Aliases">
    Make your queries more readable:

    ```sql theme={null}
    -- Bad: Hard to read
    SELECT planning_center.people_people.first_name
    FROM planning_center.people_people;

    -- Good: Clean and clear
    SELECT p.first_name
    FROM planning_center.people_people p;
    ```
  </Step>

  <Step title="Handle Money Correctly">
    Planning Center stores amounts in cents:

    ```sql theme={null}
    -- Wrong: Shows cents
    SELECT amount_cents FROM planning_center.giving_donations;

    -- Right: Shows dollars
    SELECT amount_cents / 100.0 as amount FROM planning_center.giving_donations;
    ```
  </Step>

  <Step title="Use Comments in Complex Queries">
    Document your logic for future reference and clarity
  </Step>
</Steps>

## Troubleshooting Common Issues

<AccordionGroup>
  <Accordion title="Why don't I see recent data?">
    Check the last sync time. Data syncs periodically (usually hourly).
  </Accordion>

  <Accordion title="Why are some fields NULL?">
    Planning Center allows optional fields. NULL means the field wasn't
    provided.
  </Accordion>

  <Accordion title="How do I find the right relationship type?">
    Check the relationship table to see available types: `sql SELECT DISTINCT
            relationship_type FROM planning_center.people_person_relationships; `
  </Accordion>

  <Accordion title="Why do I get duplicate rows?">
    You might be joining incorrectly. Make sure to: - Include the
    relationship\_type in your JOIN - Use DISTINCT when counting unique entities

    * Check if you need a GROUP BY clause
  </Accordion>
</AccordionGroup>

## Best Practices

1. **Always use meaningful aliases** for tables (p for people, d for donations)
2. **Comment complex logic** in your queries
3. **Test with LIMIT** before running large queries
4. **Use transactions** for updates (though most queries are read-only)
5. **Index awareness** - our tables are optimized for common query patterns
6. **Date filtering** - use indexed date columns for performance

## Key Benefits

<Steps>
  <Step title="Unified Data Access">
    Query across all your Planning Center apps with SQL, combining data that
    would normally require multiple exports
  </Step>

  <Step title="Nightly Sync">
    Your Planning Center data stays synchronized with Parable through nightly
    updates, ensuring you're working with up-to-date information
  </Step>

  <Step title="Advanced Analytics">
    Connect to Power BI, Tableau, or other BI tools to create dashboards and
    reports beyond Planning Center's built-in capabilities
  </Step>

  <Step title="Cross-App Insights">
    Discover patterns by connecting giving data with attendance, group
    participation with volunteer engagement, and more
  </Step>
</Steps>

<Note>
  All Planning Center data is accessed through Parable's secure, read-only
  connection. Your original Planning Center data remains unchanged.
</Note>

## Getting Started

To begin working with your Planning Center data in Parable:

1. **Connect Your Account**: Link your Planning Center organization to Parable
2. **Explore Your Data**: Use the SQL editor to query your synchronized data
3. **Build Dashboards**: Create custom reports in your preferred BI tool
4. **Share Insights**: Export results to share with leadership and ministry
   teams

<Tip>
  Start with simple queries to familiarize yourself with the data structure,
  then gradually build more complex cross-app analyses. Remember: Every expert
  was once a beginner!
</Tip>

## Next Steps

Ready to dive deeper? Check out our specific guides:

* [People Module Documentation](/planning-center/people/overview)
* [Giving Module Documentation](/planning-center/giving/overview)
* [Groups Module Documentation](/planning-center/groups/overview)
* [Check-ins Module Documentation](/planning-center/check-ins/overview)
* [Calendar Module Documentation](/planning-center/calendar/overview)
* [Services Module Documentation](/planning-center/services/overview)
* [Registrations Module Documentation](/planning-center/registrations/overview)
* [Publishing Module Documentation](/planning-center/publishing/overview)

## Getting Help

* **SQL Basics**: W3Schools SQL Tutorial is a great starting point
* **Planning Center API**: For detailed API information, visit [Planning Center's Developer Documentation](https://developer.planning.center/docs/#/overview/)
* **Support**: Reach out at [michael@getparable.io](mailto:michael@getparable.io)
