Custom Fields

CiviCRM has multitude of individual contact fields. Like a lot of them. They try and account for the most common cases, but sometimes you want to have contact fields that tell you information about a specific type of person. This module will explore why you should use custom fields and how to set them up.

Everett Case – Major Advisors and UCSC People

Everett is interdisciplinary so we like to maintain relationships with the various major advisors (sometimes called undergraduate program coordiantors) so that we can get in contact with them once it’s time to start our recruitment drive. We ask them to send out blurbs about us to their list serves. So the need is to have their contact information on hand. Simple enough using the existing contact fields. But sometimes we also want to go and visit them in person. This means you have to look them up on the campus directory. It would be nice to have their office locations. You can do that using the existing address field, but it’s kinda awkward to shoehorn in UCSC campus addresses sometimes when what we really need is just the office building and room number.

Thinking deeper, there are other important things to consider about UCSC people. Wouldn’t it be nice to be able to look for people by department? Or by Division? These aspects aren’t neatly reflected by the existing contact fields. Let’s explore how we used custom fields for the Everett databse and how we set them up.

How Do?

You start by reading the CiviBook Entry on Custom Fields. Yes read it. Then mosey on over to Administer > Customize Data and Screens > Custom Fields to make your own custom fields.

Create a New Field Set

This step is obvious because you read the CiviBook entry. Before creating a custom field, you need to create a set in which to put it. For the purposes of this example, we’ll go with UCSC Info. It’s descriptive but not overly specific. As time goes on, and we better understand our own needs, we can add more fields that don’t necessarily pertain to advisors.

Set What It’s Used for

You can create custom fields for any data type (contacts, activities, events, etc.). We’ll make this set apply to Individual contacts.

Multiple Records

You’ll see a checkbox appear asking “Does this Custom Field Set allow multiple records?”. For simplicity’s sake, don’t check this box. Multiple records are for things like “Employment History”, where you might want to have official records of someone’s last 5 employers. This is a fine thing to have in your database, but there are two big caveats:

  1. The fields in this set will not be importable through the normal importer which is a huge drawback. You would have to use the Multi-value Custom Importer (good luck finding it!). We’re really not sure how this thing works yet, but if you can figure it out, please tell us how you did it because it would be great for the site.
  2. You cannot export mulit-record data, only the most recent record.

Display Style

This sets how the custom set info will show up when you’re looking at an individual’s profile. Will it show up on the first screen? Or will you want it all in another tab? I prefer to have this field display inline and uncollapsed rather than as a tab because I don’t want to have to click around to find out.

Creating the Fields

Now that the field set is created, you can start creating the actual fields. Using our UCSC Info example, let’s start with Department.

Data and Input Field Type

We don’t need to go into too much detail here as you can play around with these to your heart’s content. Basically, you just need to choose two things:

  • What type of data you want
  • How you want that data entered

Data Type

This refers to whether it’s alphanumeric text, numbers, money, dates, files, etc.

Input Field Type

Should you have a text field? Check boxes? Radio buttons? A dropdown menu? It’s all about how much freedom and constraint you want in the choices.

With that in mind, we’ll choose Alphanumeric for our data type, and Text for our input type. Alphanumeric because it wouldn’t make sense to look at someones profile and under “Department” it reads, “$3.50″. We choose text because there are like 40 departments and we trust whoever is doing this to type it in correctly. If the field were something with fewer options and you wanted to make sure only those options were ever chosen, then you might want to choose Select or Radio Buttons.

Offer Help?

You can add explanatory text before or after the field so that when someone is entering contacts through civi, they’ll have some context. Ideal your chosen field label is clear enough on its own.

Searchable?

It bothers me that this isn’t checked by default. I mean, I made the field so obviously I’d want to search for it later, right? Click it and then save the field. We created two more fields in this set, Office Bldg. and Office Number

Importing Into Custom Fields

With the Everett database, we had a whole bunch of Excel sheets for different groups. This might not always be your situation, but typically, if you have a bunch of contacts (like from a sign up sheet or left over from an old system) it’s best to enter them into a spreadsheet before importing them to Civi. It’s much quicker than adding them one by one.

Setting Up Your Import Sheet

You’ve (probably) imported before, so you should be familiar with this. Make a header row where the column names match the fields in CiviCRM:

  • First Name
  • Last Name
  • Email
  • Office Bldg. :: UCSC Info
  • Office Number :: UCSC Info
  • Department :: UCSC Info

Now, when you go to import the contacts, it will automatically map to the right fields and you will have all your info upload correctly!