Workflow: where respondents and targets live

Every assembly has one home for its respondents and targets: either an external Google Sheets spreadsheet, or the OpenDLP database. This page follows the data from where it starts to where the selection reads it, and back out again.

One source of truth per assembly. With Google Sheets, the spreadsheet is the truth and OpenDLP keeps nothing on disk. With the OpenDLP database, the database is the truth: copies can exist elsewhere (a CSV you uploaded, a spreadsheet OpenDLP exports to) but they are secondary, and changing them does not change the assembly.

Google Sheets OpenDLP database Targets step Respondents step Registration page Selection Secondary copy Planned, not built yet

The top-level split

The first choice for an assembly is its data source. Everything else on this page hangs off that choice.

flowchart TD
    classDef sheet  fill:#c8e6c9,stroke:#2e7d32,color:#0b0c0c
    classDef db     fill:#cce2f7,stroke:#1d70b8,color:#0b0c0c
    classDef select fill:#d7ccc8,stroke:#5d4037,color:#0b0c0c

    Q{"Where do this assembly's<br/>respondents and targets live?"}

    GS["External Google Sheets<br/>spreadsheet"]:::sheet
    DB[("OpenDLP database")]:::db

    Q --> GS
    Q --> DB

    GS --> P0["Path 0<br/>You fill the spreadsheet,<br/>OpenDLP reads it"]:::sheet

    DB --> P1["Path 1<br/>Targets CSV +<br/>respondents CSV"]:::db
    DB --> P2["Path 2<br/>Targets in web UI +<br/>registration page"]:::db
    DB --> P3["Path 3<br/>Path 2 + auto-export<br/>to Google Sheets"]:::db
    DB --> P4["Path 4<br/>Path 2 + some<br/>respondents by CSV"]:::db
    DB --> P5["Path 5<br/>Targets CSV +<br/>registration page"]:::db
    DB --> P6["Path 6<br/>Respondents CSV, then<br/>targets built from it"]:::db

    S0(["Selection reads the spreadsheet,<br/>writes results back to it"]):::select
    SD(["Selection reads the database,<br/>writes results back to it"]):::select

    P0 --> S0
    P1 --> SD
    P2 --> SD
    P3 --> SD
    P4 --> SD
    P5 --> SD
    P6 --> SD

    click GS "#path-0" "Path 0 - external Google Sheets"
    click P0 "#path-0" "Path 0 - external Google Sheets"
    click DB "#db-routes" "Every route into the database"
    click P1 "#path-1" "Path 1"
    click P2 "#path-2" "Path 2"
    click P3 "#path-3" "Path 3"
    click P4 "#path-4" "Path 4"
    click P5 "#path-5" "Path 5"
    click P6 "#path-6" "Path 6"
    click S0 "#path-0" "Path 0 - external Google Sheets"
    click SD "#selection-detail" "Selection from the database"
            

Click any box to jump to the flow chart that expands it. The six database paths are the common ones, not every combination: see combining routes.

Path 0 — External Google Sheets

The respondents and targets live in a Google Sheets spreadsheet that the organiser looks after. OpenDLP is told the spreadsheet's URL and the names of the two tabs that hold the respondents and the targets. It never stores the respondents: it reads them into memory when a selection runs, and writes the results straight back to the same spreadsheet.

flowchart LR
    classDef sheet  fill:#c8e6c9,stroke:#2e7d32,color:#0b0c0c
    classDef target fill:#fad7a8,stroke:#b58840,color:#0b0c0c
    classDef resp   fill:#f8bbd0,stroke:#ad1457,color:#0b0c0c
    classDef select fill:#d7ccc8,stroke:#5d4037,color:#0b0c0c
    classDef mem    fill:#ffffff,stroke:#505a5f,color:#0b0c0c,stroke-dasharray:5 5

    subgraph SHEET["Organiser's Google Sheets spreadsheet"]
        direction TB
        T["Targets tab"]:::target
        R["Respondents tab"]:::resp
        OUT["New tabs:<br/>Original Selected - output - N<br/>Remaining - output - N"]:::sheet
    end

    C["Organiser gives OpenDLP<br/>the URL + both tab names"]:::sheet
    M["Selection runs<br/>(data in memory only)"]:::mem
    S(["Selection result"]):::select

    C --> M
    T -. read .-> M
    R -. read .-> M
    M --> S
    S -. write .-> OUT

    click C "#gs-config" "Configuring Google Sheets"
    click M "#gs-memory" "Nothing saved to disk"
    click OUT "#gs-memory" "Results go back to the spreadsheet"
            

Click a box to jump to its details.

Telling OpenDLP about the spreadsheet

On the Data tab the organiser picks Google Sheets, pastes the spreadsheet URL, and names the tab with the respondents and the tab with the targets. For a replacement selection there can also be a third tab, listing the people already selected. The spreadsheet must be shared with OpenDLP's service account so it can read and write.

Everything about the data — adding a respondent, changing a target value, fixing a typo — happens in the spreadsheet, using whatever tools the organiser already has. OpenDLP only sees the change the next time it reads.

Nothing about respondents is saved to disk

When a selection runs, OpenDLP reads both tabs into memory, runs the selection, and writes the selected respondents (and the remaining respondents) to new tabs in the same spreadsheet. The tab names come from the sortition-algorithms library (GSheetTabNamer), not from OpenDLP: Original Selected - output - N and Remaining - output - N, where N is the lowest number not already used, so earlier runs are never overwritten. None of the respondent details are saved by OpenDLP; once the task is done they are gone from OpenDLP entirely.

That makes this path simple to reason about for erasure requests: the spreadsheet is the only copy to blank.

The OpenDLP database — every route in

For every other workflow, the canonical data is in the OpenDLP database. This chart shows each route by which targets and respondents can get there, built or planned. The paths further down are particular journeys through it.

flowchart LR
    classDef db     fill:#cce2f7,stroke:#1d70b8,color:#0b0c0c
    classDef target fill:#fad7a8,stroke:#b58840,color:#0b0c0c
    classDef resp   fill:#f8bbd0,stroke:#ad1457,color:#0b0c0c
    classDef reg    fill:#e1bee7,stroke:#6a1b9a,color:#0b0c0c
    classDef copy   fill:#ffffff,stroke:#505a5f,color:#0b0c0c,stroke-dasharray:5 5
    classDef plan   fill:#f3f2f1,stroke:#b1b4b6,color:#505a5f,stroke-dasharray:5 5

    subgraph TARGETS_IN["Targets in"]
        direction TB
        TUI["Enter in the web UI,<br/>from scratch"]:::target
        TFR["Build from respondent data,<br/>then enter the numbers<br/>(needs respondents first)"]:::target
        TCSV["Upload a targets CSV"]:::target
        TTAB["Import a table: Google Sheets,<br/>xlsx, Excel Online ..."]:::plan
        TCOPY["Copy from another assembly"]:::plan
    end

    subgraph RESP_IN["Respondents in"]
        direction TB
        RCSV["Upload a respondents CSV"]:::resp
        RREG["People sign up on<br/>the registration page<br/>(needs targets first)"]:::reg
        RTAB["Import a table: Google Sheets,<br/>xlsx, Excel Online ..."]:::plan
    end

    DBT[("Targets")]:::db
    DBR[("Respondents")]:::db

    TUI --> DBT
    TFR --> DBT
    TCSV --> DBT
    TTAB -.-> DBT
    TCOPY -.-> DBT

    RCSV --> DBR
    RREG --> DBR
    RTAB -.-> DBR

    subgraph OUT["Secondary copies out"]
        direction TB
        XCSV["Export respondents to CSV"]:::copy
        XGS["Export respondents to<br/>Google Sheets"]:::copy
        XAUTO["Auto-export every<br/>respondent change<br/>to Google Sheets"]:::copy
        XT["Export targets"]:::plan
    end

    DBR -.-> XCSV
    DBR -.-> XGS
    DBR -.-> XAUTO
    DBT -.-> XT

    click TUI "#t-ui" "Targets in the web UI"
    click TFR "#t-from-resp" "Targets from respondent data"
    click TCSV "#t-csv" "Targets CSV"
    click TTAB "#planned" "Planned"
    click TCOPY "#t-copy" "Copy from another assembly"
    click RCSV "#r-csv" "Respondents CSV"
    click RREG "#r-reg" "Registration page"
    click RTAB "#planned" "Planned"
    click XCSV "#exports" "Exports"
    click XGS "#exports" "Exports"
    click XAUTO "#exports" "Exports"
    click XT "#exports" "Exports"
            

Grey dashed boxes are planned. White dashed boxes are secondary copies: OpenDLP is still the source of truth.

Targets: enter them in the web UI, from scratch

Add each target (Gender, Age ...), then its values (Woman, Man, Non-binary ...), then the numbers: percentage, and the min and max to select. See the targets and fields workflow for that flow in detail.

Targets: build them from respondent data

When respondents are already in the database, OpenDLP can propose targets and values from the respondents' columns: pick a column, and its distinct values become the target's values. The organiser then fills in the numbers in the web UI. This is the only route that needs respondents first.

Targets: upload a targets CSV

One row per target value: the target, the value, and the numbers. The planned imports from Google Sheets, xlsx files, Excel Online and so on take a table of the same shape, so on this page they count as variations of the CSV upload.

Targets: copy from another assembly (planned)

Copies the targets, their values and each value's percentage, but not the min and max. Those are worked out afresh from the copied percentage and the new assembly's number to select — the old assembly's min and max were for a different number of people.

Respondents: upload a respondents CSV

One row per respondent, one column per question. As with targets, the planned imports from other tabular sources take a table of the same shape and count as variations of this upload.

Respondents: the registration page

The organiser builds a registration page, and each person who signs up becomes a respondent in the database. Targets are expected to exist before the page is built: building the page starts by linking each target to the question that answers it, so that every respondent arrives with the data every target needs. See the registration page workflow.

The main paths through the database

Six common journeys. They differ in where the targets come from, where the respondents come from, and what order those happen in. All of them end the same way: a selection from the database.

Path 1 — Upload targets, upload respondents

Both arrive as uploads. The order does not matter here — neither upload depends on the other — but targets first is the natural way to think about it.

flowchart LR
    classDef db     fill:#cce2f7,stroke:#1d70b8,color:#0b0c0c
    classDef target fill:#fad7a8,stroke:#b58840,color:#0b0c0c
    classDef resp   fill:#f8bbd0,stroke:#ad1457,color:#0b0c0c
    classDef select fill:#d7ccc8,stroke:#5d4037,color:#0b0c0c

    A["Upload targets CSV"]:::target
    B["Upload respondents CSV"]:::resp
    D[("OpenDLP database")]:::db
    S(["Selection"]):::select

    A --> B --> D --> S

    click A "#t-csv" "Targets CSV"
    click B "#r-csv" "Respondents CSV"
    click S "#selection-detail" "Selection"
            

Path 2 — Targets in the web UI, then a registration page

The fully in-OpenDLP route: no files at all.

flowchart LR
    classDef db     fill:#cce2f7,stroke:#1d70b8,color:#0b0c0c
    classDef target fill:#fad7a8,stroke:#b58840,color:#0b0c0c
    classDef reg    fill:#e1bee7,stroke:#6a1b9a,color:#0b0c0c
    classDef select fill:#d7ccc8,stroke:#5d4037,color:#0b0c0c

    A["Enter targets<br/>in the web UI"]:::target
    B["Build registration page<br/>starting from the targets"]:::reg
    C["People register"]:::reg
    D[("Respondents in<br/>OpenDLP database")]:::db
    S(["Selection"]):::select

    A --> B --> C --> D --> S

    click A "#t-ui" "Targets in the web UI"
    click B "#r-reg" "Registration page"
    click C "#r-reg" "Registration page"
    click S "#selection-detail" "Selection"
            

Path 3 — Path 2, with respondents auto-exported to Google Sheets

The same as path 2, but every change to a respondent is copied to a Google Sheets spreadsheet as it happens. The spreadsheet is a convenience for the team — to filter, sort or share — not a second source of truth: edits made in it do not come back.

flowchart LR
    classDef db     fill:#cce2f7,stroke:#1d70b8,color:#0b0c0c
    classDef target fill:#fad7a8,stroke:#b58840,color:#0b0c0c
    classDef reg    fill:#e1bee7,stroke:#6a1b9a,color:#0b0c0c
    classDef select fill:#d7ccc8,stroke:#5d4037,color:#0b0c0c
    classDef copy   fill:#ffffff,stroke:#505a5f,color:#0b0c0c,stroke-dasharray:5 5

    A["Enter targets<br/>in the web UI"]:::target
    B["Build registration page<br/>starting from the targets"]:::reg
    C["People register"]:::reg
    D[("Respondents in<br/>OpenDLP database")]:::db
    G["Google Sheets spreadsheet<br/>(read-only copy)"]:::copy
    S(["Selection"]):::select

    A --> B --> C --> D --> S
    D -. "auto-export<br/>on every change" .-> G

    click A "#t-ui" "Targets in the web UI"
    click B "#r-reg" "Registration page"
    click C "#r-reg" "Registration page"
    click G "#exports" "Exports"
    click S "#selection-detail" "Selection"
            

Path 4 — Path 2, plus some respondents from a CSV

Most respondents come through the registration page, but the organiser also does some targeted recruitment outside it — door-knocking, a community group, a phone list — and uploads those respondents as a CSV. Both streams end up in the same pool.

flowchart LR
    classDef db     fill:#cce2f7,stroke:#1d70b8,color:#0b0c0c
    classDef target fill:#fad7a8,stroke:#b58840,color:#0b0c0c
    classDef resp   fill:#f8bbd0,stroke:#ad1457,color:#0b0c0c
    classDef reg    fill:#e1bee7,stroke:#6a1b9a,color:#0b0c0c
    classDef select fill:#d7ccc8,stroke:#5d4037,color:#0b0c0c

    A["Enter targets<br/>in the web UI"]:::target
    B["Build registration page<br/>starting from the targets"]:::reg
    C["People register"]:::reg
    X["Targeted recruitment<br/>outside the page"]:::resp
    U["Upload respondents CSV"]:::resp
    D[("Respondents in<br/>OpenDLP database")]:::db
    S(["Selection"]):::select

    A --> B --> C --> D
    X --> U --> D
    D --> S

    click A "#t-ui" "Targets in the web UI"
    click B "#r-reg" "Registration page"
    click C "#r-reg" "Registration page"
    click U "#r-csv" "Respondents CSV"
    click S "#selection-detail" "Selection"
            

The uploaded CSV needs the same columns the registration page collects — at least one for every target — or those respondents cannot be selected fairly.

Path 5 — Upload targets, then a registration page

Path 2 with the targets uploaded instead of typed in — handy when the targets already exist in a spreadsheet from the planning work.

flowchart LR
    classDef db     fill:#cce2f7,stroke:#1d70b8,color:#0b0c0c
    classDef target fill:#fad7a8,stroke:#b58840,color:#0b0c0c
    classDef reg    fill:#e1bee7,stroke:#6a1b9a,color:#0b0c0c
    classDef select fill:#d7ccc8,stroke:#5d4037,color:#0b0c0c

    A["Upload targets CSV"]:::target
    B["Build registration page<br/>starting from the targets"]:::reg
    C["People register"]:::reg
    D[("Respondents in<br/>OpenDLP database")]:::db
    S(["Selection"]):::select

    A --> B --> C --> D --> S

    click A "#t-csv" "Targets CSV"
    click B "#r-reg" "Registration page"
    click C "#r-reg" "Registration page"
    click S "#selection-detail" "Selection"
            

Path 6 — Upload respondents, then build targets from them

The one path where respondents come first. The respondent data already says which values exist in each column, so the targets and their values are built from it and the organiser only has to fill in the numbers.

flowchart LR
    classDef db     fill:#cce2f7,stroke:#1d70b8,color:#0b0c0c
    classDef target fill:#fad7a8,stroke:#b58840,color:#0b0c0c
    classDef resp   fill:#f8bbd0,stroke:#ad1457,color:#0b0c0c
    classDef select fill:#d7ccc8,stroke:#5d4037,color:#0b0c0c

    A["Upload respondents CSV"]:::resp
    B["Create targets and values<br/>from respondent data"]:::target
    C["Fill in the target numbers<br/>in the web UI"]:::target
    D[("OpenDLP database")]:::db
    S(["Selection"]):::select

    A --> B --> C --> D --> S

    click A "#r-csv" "Respondents CSV"
    click B "#t-from-resp" "Targets from respondent data"
    click C "#t-ui" "Targets in the web UI"
    click S "#selection-detail" "Selection"
            

Around the paths

Combining routes

The paths are the common journeys, not the only ones. Any route into the database can be followed by any other, because they all write to the same place:

The one ordering that matters: a registration page is built from targets, so targets come before the page. Adding a target after the page is live means the page needs a question for it too.

Selection from the database

The selection reads targets and respondents from the database and records the result there too: each respondent's status changes to show whether they were selected. Nothing needs to go out to a spreadsheet for the selection to happen; exporting the result is an optional extra.

Exports: secondary copies

Exports are not part of how data gets in, but they help teams with tasks that suit a spreadsheet better than a web page.

ExportStatusNotes
Respondents to CSVBuiltA one-off download.
Respondents to Google SheetsBuiltA one-off write to a spreadsheet.
Auto-export respondents to Google SheetsBuiltEvery respondent change is copied across, a short while after it happens. See path 3.
TargetsPlanned

In every case OpenDLP stays the source of truth. A change made in an exported copy does not flow back, and the next auto-export will overwrite it.

Planned and possible routes not drawn as paths

Planned:

Possible, one day: import targets or respondents from non-tabular data (such as a JSON upload), or set them through a REST API. Left out of the charts so they stay about what exists or is on the way.

Glossary

Data source
Where an assembly's respondents come from, as chosen on the Data tab: Google Sheets, or the OpenDLP database (filled by CSV upload, registration page, or both). It never means where a target's percentages come from.
Respondent
Anyone in an assembly's data, whatever their status: in the pool, selected, or confirmed.
Target
One thing the selection balances on, such as Gender or Age. Each has values (Woman, 18–24 ...), and each value has the numbers: a percentage, and a min and max to select.
Tab
One tab inside a Google Sheets spreadsheet. The code sometimes calls it a worksheet.
Erasure
When someone asks for their details to be deleted, every copy has to be found and blanked. On the database paths OpenDLP blanks the respondent's row; any exported copies are the organiser's to deal with. On path 0 the spreadsheet is the only copy.