Skip to main content

Importing Persons from CSV

Admin → Import creates or updates persons, families, groups and notes from a spreadsheet with one person per row. Only system administrators can use it.

Importing has two steps. First you upload the file and Jethro checks it, showing a preview of everything it will create or update. Nothing changes until you click Proceed with import on the preview. If any row has a problem, Jethro lists the errors by row number and nothing is imported, so you can fix the file and upload it again.

Preparing the file​

The easiest start is the sample file linked from the import page. It contains every column Jethro recognises, including your custom fields, and example rows that use your own congregations, statuses and age brackets.

  • Upload file expects comma-separated values (CSV), as saved by Excel, LibreOffice or Google Sheets.
  • Paste text expects tab-separated values, which is what you get when you copy cells straight from a spreadsheet.
  • From Google Spreadsheet fetches a sheet directly: paste its share link, optionally name the tab, and optionally upload a service-account JSON key. Without a key the sheet must be readable by anyone with the link; with a key, share the sheet with the key's service account (Viewer). The key is used for that import only and is not stored. The sheet URL and name are remembered for your session, so the next import starts from the same sheet; the key itself is not remembered. For recurring imports, use the scheduled importer with a key kept on the server: see Private Google Sheets access.
  • The first row must hold the column headers. Column order doesn't matter, and headers are not case-sensitive: First Name and first_name are the same column.
  • Jethro warns about, and ignores, any column it doesn't recognise.

Required columns​

Every file must contain these columns:

ColumnValue
last_name
first_name
age_bracketAge bracket label, e.g. Adult

Optional columns​

ColumnValue
family_nameName of the person's family. If the column is omitted, the row's last_name is used; a blank cell continues the family above
congregationCongregation name (short or long), e.g. 6pm. May be blank unless the person's status requires a congregation
statusPerson status label, e.g. Core, Crowd, Newcomer. It must match a label configured in your Jethro instance. Blank means the default status for new persons, and no change when updating
personid (or ID)Jethro person ID of an existing person to update. See Updating existing persons
gendermale, female or unknown
email, mobile_tel (or mobile), work_telPerson contact details
home_tel, address_street, address_suburb, address_state, address_postcodeFamily contact details
custom field nameA value for that custom field. Spaces in the field name may be written as _
note (or notes)Text of a note to add to the person, with the subject "Import note"
groupName of a group to add the person to. Repeat the column to add several groups
groupif[...]Conditional group membership; see Groups

Generating the file from a Google Form​

A form-linked spreadsheet is a convenient source: collect the answers once, and let a second tab rearrange them into the columns Admin → Import expects. No copying is needed as responses arrive.

1. Build the form​

Google Form with person type, first name and last name questions

Ask at least First name, Last name and Age bracket. Useful extras are Person type (Adult/Child), Email, Mobile and Notes. The formulas below look questions up by their exact titles, so keep the titles as written here (or change the formulas to match).

  • Rows with the same family name are grouped into one family while they remain consecutive; a single submission per family is the simplest way to guarantee that.
  • Ask for an age bracket using one of your Jethro age-bracket labels, e.g. Adult, Primary School (Yr 3-6).
  • Ask for mobile numbers in a format Jethro accepts: local with the leading zero (0491 570 159) or international (61491570159).
  • A question titled Notes is optional; its answer becomes a person note.

In the form, choose Responses → Link to Sheets. Google adds a Form Responses tab:

Form Responses tab with timestamp, person type, names, email, mobile and age bracket

The Timestamp and Person type columns are form metadata and are not imported directly.

3. Add an import tab​

Create a second tab named import with exactly these headers in row 1:

CellHeader
A1family_name
B1last_name
C1first_name
D1congregation
E1status
F1age_bracket
G1email
H1mobile_tel
I1note

Then paste these nine formulas into row 2 (A2:I2). The ARRAYFORMULA fills every response row below, and MATCH finds each answer by its question title, so the order of columns in Form Responses does not matter:

A2 =ARRAYFORMULA(IF('Form Responses'!A2:A="","",INDEX('Form Responses'!A2:K,0,MATCH("Last name",'Form Responses'!A1:K$1,0))))
B2 =ARRAYFORMULA(IF('Form Responses'!A2:A="","",INDEX('Form Responses'!A2:K,0,MATCH("Last name",'Form Responses'!A1:K$1,0))))
C2 =ARRAYFORMULA(IF('Form Responses'!A2:A="","",INDEX('Form Responses'!A2:K,0,MATCH("First name",'Form Responses'!A1:K$1,0))))
D2 =ARRAYFORMULA(IF('Form Responses'!A2:A="","","4pm Kids"))
E2 =ARRAYFORMULA(IF('Form Responses'!A2:A="","","Current"))
F2 =ARRAYFORMULA(IF('Form Responses'!A2:A="","",INDEX('Form Responses'!A2:K,0,MATCH("Age bracket",'Form Responses'!A1:K$1,0))))
G2 =ARRAYFORMULA(IF('Form Responses'!A2:A="","",INDEX('Form Responses'!A2:K,0,MATCH("Email",'Form Responses'!A1:K$1,0))))
H2 =ARRAYFORMULA(IF('Form Responses'!A2:A="","",INDEX('Form Responses'!A2:K,0,MATCH("Mobile",'Form Responses'!A1:K$1,0))))
I2 =ARRAYFORMULA(IF('Form Responses'!A2:A="","",INDEX('Form Responses'!A2:K,0,MATCH("Notes",'Form Responses'!A1:K$1,0))))

import tab with one row per form response, ready for CSV download

Adapt these parts to your instance:

  • A and B both use “Last name”. family_name is filled from the surname so the family is grouped correctly; the person's last_name gets the same value.
  • "4pm Kids" (D) and "Current" (E) are fixed values. Replace them with a congregation name and a person status label that exist in your Jethro instance. A label that does not exist is a row error and the import is rejected.
  • Form Responses must match the tab name Google created, and every title in MATCH(...) must exist in its header row. If you do not collect Notes, replace I2 with a blank cell or remove the column.
  • If you add questions beyond column K, widen A2:K and A1:K$1 in the formulas.

4. Import the sheet​

Open the import tab and choose File → Download → Comma-separated values (.csv), then upload that file at Admin → Import. Tick Update existing persons if they match so repeat submissions update people instead of creating duplicates. For an unattended import, the same tab can be fetched by scripts/import_persons.php --google-spreadsheet, which uses the spreadsheet's last tab by default or the tab named by --google-spreadsheet-tab; see the developer reference. To keep the sheet private, share it with a Google service account and pass its key with --google-service-account; the setup steps are in Private Google Sheets access.

Families​

Jethro reads consecutive rows as members of the same family. A row starts a new family when:

  • it has a different family_name, street, suburb, state or home phone from the rows above, or
  • there is a blank row above it.

Family details can be on any row of the family, not only the first. If the file has no family_name column, each row's last_name stands in for it, so consecutive rows with the same surname form a family.

Groups​

All persons created or updated by an import are added to one group, as a record of the import. Choose either Create a new group (give it a name and, optionally, a category) or Add to an existing group.

A group column adds the person to the group with that name. If no such group exists, it is created. The preview lists which groups will be created.

A groupif column decides group membership from the content of the cell:

HeaderAdds the person to the group in [...] when the cell...
groupif[Cleaners]is not blank
groupif{cleaning}[Cleaners]contains "cleaning"
groupif{men's events}!{women's}[Men's events team]contains "men's events" but not "women's"

Matching is not case-sensitive. This is handy for spreadsheets exported from online forms, where one column lists every ministry a person ticked.

Updating existing persons​

Tick Update existing persons if they match to update people already in Jethro instead of creating duplicates. A row matches an existing person:

  1. By person ID, when the row has a value in the personid column. The ID always identifies exactly that person, even an archived one, whatever names the row contains.

  2. By name otherwise: the first and last name must match exactly one existing person. When several persons share the name, Jethro warns and imports the row as a new person. These options narrow name matching:

    • Don't match if email address is different
    • Don't match if mobile number is different

    A blank value in either the file or Jethro never prevents a match.

When an imported value differs from what Jethro holds, you choose whether to use the value from the import file or preserve the existing value in Jethro. A blank cell never clears an existing value.

Unmatched rows that follow a matched person in the same family are added to that person's existing family.

The personid column​

The personid column is optional. Leave it out, or leave it blank, for persons who are new to Jethro. It is useful for bulk updates:

  1. Select persons in a list or report and download them as CSV. Jethro's CSV download heads the person ID column ID, which the importer accepts as personid.
  2. Edit the file, keeping the ID column, and add the required columns if they aren't there.
  3. Import it with Update existing persons if they match ticked.

A non-blank personid must be right, so these are errors that stop the import:

ErrorCause
Invalid person ID "x"The value is not a whole number above zero
There is no person with ID nNo person in Jethro has that ID
Person ID n was supplied but updating existing persons is not enabledUpdate existing persons if they match is unticked. Tick it, or clear the column to import those rows as new persons