Webform CiviCRM Integration

A powerful form builder that integrates Drupal's Webform module with CiviCRM, enabling seamless data collection and CRM functionality.

webform_civicrm
2,379 sites
23
drupal.org

Install

Drupal 10, 9 v6.3.1
composer require 'drupal/webform_civicrm:^6.3'

Overview

Webform CiviCRM Integration is a comprehensive module that bridges Drupal's Webform module with CiviCRM, the open-source constituent relationship management system. It transforms webforms into powerful data collection tools that directly interact with your CiviCRM database.

The module allows you to create anything from simple newsletter signup forms to complex multi-step registration systems, event registrations, membership signups, and donation forms. All form submissions can automatically create or update contacts, process payments, register participants for events, create memberships, record activities, manage relationships, and much more.

With an intuitive administrative interface, site builders can configure which CiviCRM entities and fields to expose on the webform, set up automatic contact matching rules to prevent duplicates, and control how data flows between Drupal and CiviCRM without writing any code.

Features

  • Create and update CiviCRM contacts (Individuals, Organizations, Households) from webform submissions with automatic duplicate detection using configurable matching rules
  • Process online payments through supported payment processors (Stripe, IATS, and other on-site processors) with recurring payment support
  • Register participants for CiviCRM events with configurable registration options, pricing, and capacity validation
  • Create and renew CiviCRM memberships with automatic term calculation and payment integration
  • Record activities and cases linked to contacts with configurable activity types, statuses, and assignments
  • Manage contact relationships between multiple contacts on the same form with support for employer/employee and custom relationship types
  • Support for CiviCRM custom fields with both static and live option loading for select lists
  • Add contacts to groups and assign tags based on form submissions with optional double opt-in for mailing lists
  • Process contributions with line items, soft credits, and configurable receipt emails
  • Grant application forms with status tracking and custom field support
  • Pre-populate forms for logged-in users or via CiviMail checksum links for personalized anonymous access
  • Autocomplete contact selection with configurable filters by group, tag, relationship, and contact subtype
  • Billing address fields with option to copy from contact address
  • Multi-contact forms supporting registration of multiple people in a single submission

Use Cases

Donation Form

Create a donation form that collects donor information, processes credit card payments through supported payment processors, creates or updates the donor's contact record in CiviCRM, records the contribution with optional recurring payment setup, and sends automated receipt emails.

Event Registration

Build an event registration form that allows users to register themselves and additional participants for CiviCRM events. Supports participant selection from multiple events, price set integration, waitlist handling, and automatic participant status management.

Membership Signup and Renewal

Create membership forms that allow new members to sign up and existing members to renew. Supports multiple membership types, automatic term calculation, payment collection, and member communication preferences.

Newsletter Signup

Simple or complex newsletter signup forms that add contacts to CiviCRM groups (mailing lists). Supports double opt-in confirmation emails for public mailing lists and can collect additional contact information.

Volunteer Application

Create volunteer intake forms that capture contact details, interests, availability, and skills. Use activities to track the application, assign the volunteer to groups, and establish relationships with staff contacts.

Grant Application

Build grant application forms that create grant records in CiviCRM with configurable grant types, amounts, and status tracking. Collect applicant information and supporting documentation.

Contact Update Form

Allow existing contacts to update their own information by sending personalized links via CiviMail with checksums. The form pre-populates with their existing data and updates their CiviCRM record on submission.

Multi-Contact Relationship Form

Collect information about multiple related contacts in a single form, such as a parent registering children for a program. Automatically creates relationship records between the contacts in CiviCRM.

Tips

  • Use the 'Existing Contact' field with the 'Static' widget and 'Current User' default for forms that should automatically know who the submitter is.
  • Enable 'Live Options' for event and membership type fields to automatically reflect changes made in CiviCRM without updating the webform.
  • Use CiviMail checksums in the URL to allow anonymous users to access forms with their contact information pre-filled. The format is: /form-url?cid1={contact.id}&{contact.checksum}
  • Configure appropriate dedupe rules in CiviCRM and select them in the webform's matching rule setting to prevent duplicate contacts.
  • Use the 'Block Unknown Users' option for sensitive forms that should only be accessible to known contacts.
  • For multi-page forms with payments, the payment fields will automatically be placed on a separate 'Payment' page.
  • Test payment forms thoroughly in test mode before going live. Most payment processors have test/sandbox modes that should be used during development.
  • The 'Fields to Lock' option in the Existing Contact field settings can prevent users from editing certain fields when a contact is already selected.
  • Use the 'Source Label' setting to track where contacts and other entities originated from when reviewing CiviCRM data.

Technical Details

Admin Pages 1
CiviCRM Settings /admin/structure/webform/manage/{webform}/civicrm

Configure CiviCRM integration for a specific webform. This comprehensive settings page allows you to enable and configure all CiviCRM entities, fields, and processing options for form submissions.

Permissions 1
Access CiviCRM

Required to access the CiviCRM tab on webforms. This permission is provided by the CiviCRM module.

Hooks 1
hook_civicrm_alterMailParams

Allows altering CiviCRM mail parameters to include webform receipt settings in contribution and membership emails.

Troubleshooting 5
Payment processor not showing or payments failing

Ensure the payment processor is properly configured in CiviCRM and enabled for the contribution. Only on-site payment processors are supported (not redirect-based processors like PayPal Standard). Check that billing fields are enabled if required by the processor.

Contact not being matched correctly, duplicates being created

Review the matching rule configuration in the CiviCRM tab. Ensure the fields used in your dedupe rule are present and required on the webform. Consider using the 'Existing Contact' field for known contacts.

Custom fields not appearing in the admin interface

Custom field groups must be enabled for the relevant entity type and contact type in CiviCRM. Ensure the custom group's 'extends' setting matches what you're trying to use on the form.

Events or memberships not loading in select fields

Check that the events are active and have not ended (unless 'Show Past Events' is configured). For memberships, ensure membership types are active and properly configured in CiviCRM.

Form not autofilling for logged-in users

Configure the 'Existing Contact' field with appropriate default value settings. For Contact 1 as Individual, set default to 'Current User'. Ensure the Drupal user has a linked CiviCRM contact.

Security Notes 4
  • Always keep 'Enforce Permissions' enabled on Existing Contact fields unless you have another method of access control. This ensures users can only see and select contacts they have permission to view in CiviCRM.
  • Be cautious when using 'Allow URL autofill' for contact IDs, as this could allow users to access other contacts' data if not properly protected by checksums or other validation.
  • Payment processor credentials and sensitive configuration are stored in CiviCRM, not in Drupal, following CiviCRM's security practices.
  • Consider enabling submission limits for forms with payment processing to prevent credit card abuse.