CiviCRM

Using CiviCRM Profile

A profile is a collection of fields (both predefined and custom) from your database. By creating a profile you are able to take only those fields relevant for a specific purpose, such as collecting information about a person registering for an event or displaying a directory of members on your website. The diagram below provides a visual explanation of how existing fields are assigned for use in a profile.

Profiles

Scenarios

Profiles provide powerful tools for collecting information from your constituents as well as sharing that information through your website. These features can save significant staff time by allowing people to update their own data, and you can display up-to-date information from your database in a variety of ways.

For example, a membership-based organisation can provide a searchable membership directory on their website that is updated as soon as a new member joins. Another example is a form where people can sign up to receive emails from your organisation. Once submitted, they are automatically added to the correct email list. Profiles can also be embedded in online contribution or event pages to collect additional information about the constituent.

This section will outline how to use profiles for both collecting and sharing data.

Overview

Profiles provide an flexible set of options for creating forms, directories, and much more. Think of a profile as providing a window into your data. Just as you can have many windows in a house giving different views of the various objects inside, you can have multiple profiles which refer to the same or different fields.

There are many ways that profiles can be used:

  • Forms: a profile can be used as a form to collect information from your contacts. You can also add profiles to contribution, membership sign-up, and event registration pages to collect additional information from donors, members, and event participants. Profile forms can also be used as simplified data entry forms.
  • View/edit user account (Drupal only): it is often useful to allow your constituents to manage their own data through your website. This use of profiles allows people to edit their information when they are managing their Drupal account; this information is then automatically updated in CiviCRM.
  • Website user registration: you can include a set of fields in the new account registration form (Drupal) or create a profile that includes website user registration fields (Joomla!).
  • Directory: a profile can be used to create a searchable directory for visitors to your site.
  • Search results: using profiles allows you to display selected fields in the results of an advanced search.
  • Batch data updates (mass updates): there is often a need to update a large number of records all at once; this process can be streamlined using profiles.

Another important point about profiles is that the same profile can be reused in multiple ways.

Collecting data from constituents

This section reviews the different methods by which you can use profiles to collect information from your constituents. A later section will discuss how to share information from CiviCRM with your constituents.

Volunteer sign-up form

Let's walk through an example of a profile used as a volunteer sign-up form. This simple form includes fields for First Name, Last Name, and Mailing Address. It also includes a reCAPTCHA widget to protect your site from automated abuse (described further below).

Picture_4_200

To build a a form similar to this one:
  1. Go to: Administer > Customize > CiviCRM Profile and click on Add CiviCRM Profile.
  2. Give the profile a meaningful name, and mark it to be used for a Profile:

    Profile_checkProfile_2
  3. The next two text fields allow you to include help text to assist the person filling out the form.
  4. The remaining options are listed under Advanced Settings (click on the gray bar to expand this section):
    1. Limit listing to a group: this is very important. If the profile is used for a searchable directory, by default CiviCRM will expose every record in your database; this is not ideal in many cases. Use this setting to limit the available records to contacts who are part of a regular or smart group. For example, if an organisation needs to limit a profile listing to show only active members, they can create a smart group of all members that have a status of New and Current. They then limit the directory to only show contacts in that smart group. Remember, smart groups are dynamic lists of records; when new memberships are added, the corresponding contact will automatically be included in the directory. 
    2. Add new contacts to a group: this is applicable when using a profile as a sign-up form.  You are able to directly add all the contacts who fill out the profile form to a particular group. For example, if your profile form asks contacts to offer their services as a volunteer, then all those who fill out the form can be automatically be added to a volunteer group.
    3. Notify when profile form is submitted?: who in your organisation should receive an email when someone fills out the form? Enter their email address here. If you want to send email to multiple addresses, separate them with a comma.
    4. Redirect URL: when someone clicks Save to submit the form, do you want to take them to a specific URL? Normally you would create a special thank-you page on your website to redirect people to. If this field is left blank, the user will be directed to a page which displays the information they've just entered (a profile view page). This setting does not apply if you embed your form in an event sign-up or contribution form.
    5. Cancel Redirect URL: similar to the previous item, what is the URL you want to redirect people to if they click Cancel on the form? Again, this setting does not apply if you embed your form in an event sign-up or contribution form.
    6. Include reCAPTCHA: CAPTCHA is a type of spam blocking software that requires the visitor to fill in text generated from a graphic. This prevents automated spiders (robots) from completing the form. It is highly recommended that you include it. You must have configured a free reCAPTCHA account before enabling this. Go to Administer > Configure > Global Settings > Miscellaneous Settings to configure your account (click the help icon for on that form for detailed instructions).
    7. What to do on duplicate match: use this option to control what happens when the contact data submitted from this profile matches an existing contact record. Options are to  update the matching record, create a duplicate record, or give the user a "duplicate record" warning (in which case their input will not be saved). This setting is ignored if the profile is embedded in an online contribution, membership sign-up or event registration form. In these cases, a contact match always results in the transaction being linked to the matching contact. Note that if there are multiple matching contacts, the first matching record is used.
    8. Proximity search: if you are using this profile as a search form, you can choose to include proximity searching. When enabled, a proximity search block will be added to the search criteria. This block contains fields to set the proximity start address, and a field to set a "radius" (distance from that address). Set the proximity search as required if you want all searches using this profile to force the user to enter a start address and a radius.

Once you have saved the profile settings, it's time to add fields to the profile. If you plan to reference custom fields in a profile form, make sure that those fields have already been created.

Some important notes on adding fields:

  • You can change the name of a field label for the profile. For example, the Postal Code field can be renamed Zip Code if your audience is more familiar with that term.
  • Certain fields can be required (must be filled out). In this scenario, we would want to make at least First Name and Last Name required, and probably some sort of contact information such as email address and/or phone number.
  • You can make a field View Only, which means it will be displayed on the profile form but not editable (this setting is not relevant for the volunteer sign-up scenario).
  • If the profile is being used as a searchable directory, set the Visibility of any fields you want to include on the search form to Public Pages or Public Pages and Listings. For our volunteer sign-up scenario, we are only using the profile as a sign-up form, so we can set Visibility to User and User Admin only. This ensures that other visitors can not view any form data.
Profile_FieldSettings

Linking to your Form

Once your profile sign-up form is built, it is ready to be used! There are several ways to do this.

  • Drupal: if you intend to give your volunteers access to some back-office CiviCRM functions, you can add an item to the CiviCRM navigation menu which links to this form (from Administer > Customize > Navigation Menu). These users will need be given the "access CiviCRM" permission.
  • Drupal: create link(s) to the form using the following path: http://www.myorganization.org/civicrm/profile/create?reset=1&gid=N where N is the ID of the profile (each profile has a unique numeric ID which you can find by going to Administer > CiviCRM Profile and checking the third column of the table).
  • Drupal: create a link or a menu item for logged-in users to edit their own information. If they are logged in and go to the profile URL, the fields of the profile will be prepopulated and they will be able edit any fields needing updating. The URL path here is: http://www.myorganization.org/civicrm/profile/edit?reset=1&gid=N where N is the ID of the profile.
  • Joomla!: use the Menu Manager to create a front-end menu item. After creating a new menu item, select CiviCRM and choose the type of profile display you would like to use. In the parameters pane, choose the specific profile to use.
  • A great feature is to provide non-logged-in users with the ability to view and edit their contact information via a profile using CiviMail. To do this, insert the following link with appropriate tokens as shown into a CiviMail message:
    http://www.organisation.org/civicrm/profile/edit?reset=1&gid=N&
       id={contact.contact_id}&{contact.checksum}
    where N is the ID of the profile form you want them to use for editing. The token {contact.checksum} generates a special link that prepopulates the fields of the profile with any information that already exists for them in that profile. The special link lasts for 7 days from the day you send the mailing. This feature can be used for either Drupal or Joomla! sites.
  • The last option is to not link directly to the profile at all, but simply embed the profile form into any page on your website - or ANY website, for that matter. On the Profiles Administration page, click more. There is an option called HTML Form Snippet. Clicking it takes you to a screen where you can copy the raw HTML code and paste it into any page on your site or any website where you want to collect information. Make sure the reCAPTCHA feature is NOT enabled for this profile; reCAPTCHA requires dynamic page generation so submitting a standalone form with reCAPTCHA enabled will always result in an error.

Data entry tool

If you have volunteers or interns who perform manual data entry for your organisation, you can make their task easier by creating a profile form which shows only the fields they need to input. This greatly simplifies data entry and reduces the chance of data being incorrectly entered.

Including profiles on event registration and contribution pages

Often you will want to define certain fields for inclusion in event registration and contribution pages. This process is similar to the volunteer sign-up example above. The only significant difference is that you can include fields in your profile that are specific to participant records (for event registration forms) and contributions (for contribution pages). Read the sections covering creating contribution pages and event registration pages for more information.

Including profiles in Drupal's User Registration screen

For websites that have logged-in users, you may want to allow people to provide additional information as they register for an account on your website. Similarly, when people fill out a profile form you may want to encourage (or force) them to sign up for a user account. 

To include a profile form during the user registration process:

  1. Create a profile that is used for User Registration:

    addprofile_usedfor_reg 
  2. Add the fields you want people to fill out as they register, using the same process described above. Make sure the field visibility is set to Public User Pages.

Including profiles in Drupal's My Account screen

You can embed one or more CiviCRM profiles directly into Drupal's My Account screen. This makes it easy for logged-in users to review and update their information whenever they visit their My Account page.

To create a profile for this purpose:

  1. Create a new profile, or navigate to an existing profile and click Settings.
  2. Select in Used For.
  3. Click Save.
  4. Add the fields you want people to be able to edit from their Drupal My Account page.

New account creation during profile sign-up

If you want your constituents to create a Drupal or Joomla! account when filling out a profile, you can enable this with the "User account registration option" under Profile Settings > Advanced Settings. Anonymous (not-logged-in) users will then be invited (or required) to create an account when they visit the profile. Logged-in users will just see the profile fields.  

Profile user registration options

You must include a Primary Email Address field in the profile for this feature to function properly. This feature also works when the profile is embedded in an online contribution page or event registration page. Hence you can invite or force anonymous visitors to sign-up for an account when they register for an event.

Sharing information

Profiles and directories

Many organisations have data they would like to display on their website. Historically this has been difficult because it required updating the same data in two places - a website and a database. Using CiviCRM profiles solves this problem because it allows you to expose data from your database on your website while only needing to manage and update the data in CiviCRM.

For example, an organisation called Native Americans in Philanthropy (NAP) wanted to create a membership directory that their members could use to search and connect with other fellow members. Before CiviCRM, they would create a very expensive annual print directory and mail it to every member. This process was time-consuming and expensive, and some data would be out-of-date before the members received their directory. Switching to CiviCRM meant significant resource savings and, because their website became a portal for their members to connect, it helped to advance their mission.

To build your directory:

  1. Go to: Administer > Customize > CiviCRM Profile.
  2. Click Add CiviCRM Profile.
  3. Set Used For to Profile:

    NewProfileMemberDir

  4. Advanced Settings: there are a few options under advanced settings that are helpful when using profiles for directories.
    1. Enable mapping: a really cool feature available in CiviCRM is to allow visitors to map contacts in your directory using Google or Yahoo! maps. They can then obtain directions to a record's address dynamically. To use this feature, you must have already enabled mapping under Administer > Configure > Global Settings > Mapping and Geocoding.
    2. Include profile edit links: check this box if you want to include a link in the directory listings to allow people to edit the profile's fields. Only users with permission to edit the contact will see this link. More often than not you will not need to enable this setting as it is not commonly used in the membership directory scenario.
    3. Include Drupal user information (Drupal only): check this box if you want to include a link in the directory listings to view a contacts' Drupal user account information (e.g. their My Account page). This link will only be included for contacts who have a user account on your website.

      profile_adv_settings

Now it's time to include the fields that will make up the directory. For profiles used as directories you have total control over which fields:

  • are searchable in the directory
  • appear in the results columns of your search
  • appear in the record detail View page.

The important options you must configure in the fields for directory purposes are shown below:

directory_fields

  • Visibility for all fields in your directory must be set to Public Pages or Public Pages and Listings. The difference between these two options is that those configured as Public Pages and Listings will have the field in detail view hot-linked, enabling the user to generate a follow-up search for other records which also have that same field value. For example, you might set City to Public Pages and Listings. After the user conducts a search and views the details for a record they can click on the city value and run an immediate search. The search will run as if they had selected that city in the profile search screen.
  • The Searchable option determines if visitors to your directory can search the directory by this field. In common directory uses, almost every field is set to searchable. The more fields you set to searchable, the more power you provide to your visitors to find the information they need.
  • The Results Column check-box determines if the the field is displayed as a column in the list of results. For example, your directory may have a field for website, and if you set the website field to appear in the results column, it will appear in the results table. If you do not check the results column the field will still appear in the view mode for a record. In other words, checking Results Column? will allow the field to appear in the results column AND in detail view mode.

The image below shows the search mode for our membership directory.

Member Directory Search Form

Once you hit search you get this result set. Profile fields that have Results Column checked are shown in the listing.

MemberDirResults

Clicking the view link gives you more details about the constituent, showing all profile fields.

Profile Member View
As we've seen, building a directory for your website can provide a valuable tool for your constituents.

Linking to Your Directory

You have several options to link to your directory:

  • Drupal: link to the directory search page using this path: http://www.myorganization.org/civicrm/profile?reset=1&gid=N where N is the ID of the profile directory.
    • If you add &force=1 to the above URL it will directly show a result set.
    • If you add &force=1&search=0 it will hide the search criteria and directly show the result set.
  • Joomla!: use the Menu Manager to create a front-end menu item. After creating a new menu item, select CiviCRM and choose the profile search option. In the parameters pane, choose the specific profile to use.
  • You can also prepopulate any search criteria in the URL. These options are described here:
    http://wiki.civicrm.org/confluence/display/CRMDOC/Linking+Profiles

Other profile uses

Search results

Searching is outside the scope of this section but, assuming you are familiar with searches, you may wish to change the columns used to display the results of an advanced search. To do this:

  1. Create or open a profile and mark it as used for Search Results:

    profile_searchresults
  2. When adding fields to this profile, you will need to set Visibility for the fields to Public Pages and check the Results Column box.

When conducting your advanced search, use the Search Views dropdown menu in the top right of the page to select your profile.

Batch updates

The final way that profiles can be used is to perform batch updates of data. For example, you have a custom field called "volunteer interests" and you want to update the volunteers group with a certain interest. You can easily update the entire group using a profile.

  1. Create or open a profile and mark it as used for Profile:

    profile_batch

    No other profile settings are relevant for this type of usage.

  2. Add your fields to the profile. Only add the fields you want to batch update. In the above example, the only field you would need is your custom "volunteer interests" field (contact name is always displayed when doing batch update). Remember, fields added to the profile must all be of the same contact type. You cannot add fields that are specific to both organisations AND individuals.

Once your profile is created, and you have conducted your search, select Batch Update via Profile from the actions dropdown menu and click Go. Then select the profile you want to use.

batchscreen


You will see a grid with the fields in your profile. You can update each field and row individually. If there is a field where you want to enter the same value for ALL records, you can enter that value in the first row and then click on the "copy values" icon to the left of the column header. This will copy the field value to all the rows in your grid.

Batch Update via Profile

Don't forget to click the Update Contacts button at the bottom of the page to save your changes.

Batch update limitations

  • You cannot perform batch updates for different types of contacts (individuals and organisations, for example) at the same time.
  • If you wish to update participant fields, you must do the update from a Find Participants search (and only include participant fields in your profile).
  • You may only perform a batch update for 100 records at a time.

Combining record types in a profile

A profile usually contains fields of one record type. For example: First Name and Last Name (Individual fields). But in some cases, such as online event registration and online contribution pages, you can combine fields from two different record types (e.g. Individual + Participant fields or Individual + Contribution fields). You can also combine Individual fields with general Contact fields (e.g. Last Name + Email Address).

If you try to combine fields with an unsupported combination of record types, you'll get an error when you try to save the field.