Introduction
To start, let’s explain a little about Custom Fields in general. Of course CiviPlus has a large number of built-in fields to handle the most common pieces of data that you’ll want to store (names, email addresses etc.), but your organisation will almost certainly want to capture and use data which is specific to you. This is where custom fields come in - CiviPlus allows you to easily create your own fields of different types, and then use them for data entry, searching, segmentation, as part of rules and cases and so much more.
In CiviPlus Custom fields must be linked to one of the core record types, so in this section we show an example of custom fields that associated with the Contact record. Other articles in the Knowledge Base show how you create fields which are used as part of an Event, an Application, a Contribution and so on. You can be quite specific about the type of record that custom fields are linked to, so that you can say that a set of custom fields are only associated with an Individual Contact record, or only associated with an Organisation Contact record. And within this, you could say that the fields related to a Volunteer Contact Type, or a Branch Contact Type.
One final point before we dive into the specifics of Contact Custom Fields - Custom fields are always created as a group of fields called a Field Set. This is simply a “box” of related fields, and by including them within a Field Set with a name it makes it easier to include them on a page or form rather than having to add them individually. In the example below, each of the blocks shown by the arrow is a separate Field Set with individual fields in it.
Note: Since every field has to live in a Field Set, sometimes it might be necessary to create a Field Set with just one field in it.
How to create Custom Fields
Before you start creating your custom fields you need to spend a bit of time thinking about exactly what you want to store, what Contact Type it belongs to, what type of data it is and so on. This is pretty easy to do, but it is important that you are clear before you start creating the fields otherwise you will end up having to make changes later on, which is not ideal.
For this example, we'll assume that you have already decide upon the Personal Interests Custom Fields you want to hold in the Contact Record.
1. From the CiviPlus top menu navigate to
Administer → Customise Data and Screens → Custom Fields
2. This opens up a new page listing the existing Custom Data. Click on the ADD SET OF CUSTOM FIELDS button to start creating your new Custom Fields:
3. Firstly, you need to add details about the Field Set that is going to contain the individual fields. There are lots of options here which will affect how the Field Set is displayed and used, we’ll go through each of them so you can understand what they are used for, and how you would set them for this Personal Interests example:
Define the Set Name of the Field Set (this isn’t the title of the field itself, just the collective name for the fields).
Say what the Field Set is Used For. This “Used For” option states what CiviPlus record type new fields will be attached to - remember, all custom fields have to be associated with a particular record type. In this case since we are adding custom fields to a contact record we will select “Individual”
Now, you can specify the Order of this Field Set. Don’t worry too much about this field, you can normally use the default value that the system assigns. The Order simply says the order in which each Field Set is presented when there are more than one associated with a particular Record Type.
The next field to consider is Does this Custom Field Set allow multiple records? Checking this box allows you to enter multiple sets of values (records) for a given contact, so for example if you were creating a Field Set of custom fields to collect Employment History you might have fields for Job Title, Start Date, End Date, and Reason for Leaving. By checking the "multiple records" box you could collect this information for multiple jobs. If you select this feature, you can then also set the Maximum number of multiple records which can be recorded per contact. Using the previous example, you might only want data for the three most recent jobs.
Note: The following features are NOT available for custom fields in 'multiple record' custom set:
They can not be Exported
If they are included in a report as a display column, only the first set of values are shown.
The Display Style option is used to decide how the Field Set will be displayed. “Inline” will include this set of fields in the main contact Add/Edit form and Contact Summary screens, whereas “Tab” or “Tab with Table” (if multiple records are enabled) creates a separate navigation tab for display and editing these values. These later options are generally used for less frequently accessed and/or larger sets of fields.
There are now 4 options that control how the fields are initially displayed, and who can see them:
Collapse this set on initial display - Check this box if you want only the title for this Field Set to be displayed when the page is initially loaded (fields are hidden).
Collapse this set in Advanced Search - Check this box if you want only the title for this Field Set to be displayed when the page is initially loaded (fields are hidden) on advanced search.
Is this Custom Data Set active? - There might be times when you want to hide this Field Set. Use this option to toggle visibility and use of the fields on or off.
Is this Custom Data Set public? - Check this box if you want this custom group to be displayed on public forms.
Note: Typically the first option in the settings (collapse this set on initial display) is unchecked, the second option (collapse this set in advanced search) is checked.
Now you have the option to add explanatory text displayed at the beginning and/or end of this set of fields. You can use the rich text editor to create engaging content which can help users when they are completing the sets of fields, including linked to external material that you may wish them to view
Pre-form Help
Post-form Help
Once you have completed the Field Set form, click the SAVE button and you can then start adding the individual fields. An example of what the completed form might look like is shown below:
Now the Field Set itself has been set up, you can create fields within it. You’ll see the new Field Set you created in the list of Custom Fields, just click the View and Edit Custom Fields link, and then click ADD CUSTOM FIELD on the next page.
The process for adding each individual field to a Field Set is the same - fill in the Field definition form and save it. We’ll go through and example for one Field here, but you’ll repeat it multiple times to create all the Personal Interests custom fields in our example.
Give the Field Label meaningful value. This is what will be shown to a user when entering data, and is what will be used within reports, searches etc. In this instance we’ll enter “Sports followed”.
You should have already decided what Data Type this field is, for our example it’s an “Alphanumeric” field.
Now we want to provide a list of possible sports that are followed, so we’ll choose “Drop-down (Select list)” for the Field Input Type field, and because this person might follow various sports we’ll check the Multi-Select option.
The Display in Table option allows you to decide whether this particular field will appear in any table/list representation of multiple contacts. If the custom field is not really important you may choose not to have it displayed otherwise you can end up with a very wide table that is difficult to navigate. Of course, all the fields will appear in an individual contact record.
The Database Field Length allows you to specify the number of characters that this field will contain. Generally speaking you should use the default.
Since we have said that this field is a drop-down list we can either create and manage a list of valid picklist options within the field (set Option Type to “Create a new set of options”), or you can select an existing set of options which you've already created for another custom field (set Option Type to “Reuse an existing set”). We will pick the former in this example, and so will need to enter each of the valid picklist options.
To do this, in the Multiple Choice Options field you provide the following for each option:
Default - one or more options can be selected as Default, in which case they will be pre-selected when the list is presented.
Label - This is the picklist value that is shown to the user
Value - This is the actual value that is stored in the database, It can be the same as the Label, or different.
Order - This is the sort order that the picklist values are shown in.
Active - You can make certain choices invisible to the user by unchecking this option.
You can keep adding picklist choices by clicking on the +add another choice link.
Note: You can only add up to 10 choices when first creating the drop-list field. Once it has been created you can go back and edit it to add any number of additional choices,You use the Order field to specify the order in which this particular field should appear in the list of fields within the Field Set.
Now you have the option to add explanatory text displayed at the beginning and/or end of this fields. You can use the rich text editor to create engaging content which can help users when they are completing the field, including linked to external material that you may wish them to view
Field Pre-help
Field Post-help
The Required? Field says whether a value has to be entered into the field before the record can be saved.
You’ll almost certainly want to be able to search on this custom field (for example, to create a group of people who are interested in Netball), check the Is this Field Searchable? Field.
You can make the field invisible by unchecking the Active? field. Any field values already stored would be retained, but just “hidden”.
And lastly View Only? This is hardly ever used, but if you have a field that is populated via an api rather than via the screen you can use this option so that users can not enter a value directly.
The screenshot below shows what the Sports followed custom contact field would look like. You can click ➕SAVE AND NEW to save this new field and start creating another one, or just SAVE.