Search

Import from CSV (1.45)

Updated: May 25

This entry was imported from Group's former blog on Blogger written in 2020


Groups can now import group members from a text CSV file. CSV files are text files that contain many text lines each with many text fields separated by comma (hence CSV = Comma Separated Values). You can think of it as a table in which rows are text lines and columns are the values separated by commas


There are a few variants like TSV (Tab Separated Values). Sometimes, values can also be separated by semicolons. Groups supports 2 types (Tab and Semicolon. But not comma)


Below is an example of what the format a CSV file accepted by Groups looks like:

Id;ParentId;Name;2ndLine;Email;Phone;Description;Image;TargetGroups

00000000000000000000000000000000;null;Main Node;Born yesterday;email@assc.com;+01545123;I am a description without semicolons;195,255,0;null

63855C43BF447466C6D173917834D9F9;00000000000000000000000000000000;Secondary Node;Born today;email@assc.com;+01545123;I am a description without semicolons;/9j/4AAQSkZ...;My Family,My New Family

The first line consists of a header line (metadata). It contains the description of each field. This is a mandatory line and will always look the same as it does here


Subsequent lines contain the actual data that will be imported into your group. Each field corresponds to a field in the header line (for example, the first numeric value is the "Id")


The first data line will be the top most node in your group. Its ParentId field should be "null" as it won't have any parent above it. Following lines will constitute child members. A child's line must only appear in CSV after its parent line (not before)


Below is a breakdown of each data line field and the values they must contain:


Id: This must be a unique GUID value. The top-most node (first line) must have an Id equal to zero (00000000000000000000000000000000)


ParentId: This must be a GUID value. It must map to an Id value of a previous line (its parent). The top-most node must have a ParentId equal to "null"


Name: This must contain a text at least 2 characters long. It represents the Name of a node


2ndLine: This field can contain text and represents the 2nd text line of a node. It can be left empty and it's not mandatory


Email: Optional text field for a node's email address. It is ok to leave it empty


Phone: Optional text field for a node's phone number. It is ok to leave it empty


Description: Optional text field for a node's description. It is ok to leave it empty


Image: Mandatory text field for a node's image or colour. It can contain an R,G,B colour code (i.e. 100,255,0) or an image. Images must be Base64 encoded (text). You can convert your images to text Base64 using this tool


TargetGroups: Optional field. If empty, it must contain the word null. v1.95 will introduce the option to link a group's member to a different group. For example, a node that consists of a couple might want to link to the spouse's family tree. This field contains the exact (case sensitive) group name a node will link to. It can contain multiple groups, in which case they must be separated by comma


A few things to watch out are to not include semicolons in your text values if you are importing from semicolon-delimited CSV as this would break the column separation. (likewise, don't include tabs or in your fields if importing from that CSV type).



Once you commit your changes via the Sync menu, your group's history will show that a CSV Import was performed


This opens up Groups to many applications. You now don't need to insert the data manually if you already have it stored somewhere. You can potentially import your entire organization's structure with just a few taps. Excel or Google Sheets can be your friends as they allow you to easily massage your data into the right format