Skip to main content
All CollectionsCiviPlus Forms
Creating a simple Webform in CiviPlus
Creating a simple Webform in CiviPlus

Create a simple Webform to update custom fields on the CiviPlus contact record

C
Written by CiviPlus Helpdesk
Updated over 2 months ago

Introduction

In this example we are going to create a simple Webform that allows a user to update a set of custom contact fields that have already been created in CiviPlus. A Field Set to hold Education and Certification Details used for Contacts has been created with the following details:

  • Degree Type (Drop-down multi-select list)

    • High School Diploma

    • Associate Degree

    • Bachelor’s Degree

    • Master’s Degree

    • Doctorate (Ph.D.)

    • Professional Degree (e.g., JD, MD)

    • Vocational Training Certificate

    • None

  • Certifications Held (Data type is "Note - multi-line text box (text area)")

  • Institution Attended (Data type is "Alphanumeric - single-line input field (text or numeric)")

  • Graduation Year (Data type is "Date yy")

The article here will explain how to create custom fields if you don't already know.

The stages to create our simple Webform are:

  1. Undertake the Initial Creation of the Webform and provide some basic information

  2. Using the Webform Configuration Tabs, build the Webform content (for this simple Webform we don't need to configure all the tabs, just the ones shown in bold below).

    1. CiviCRM tab to specify the CiviPlus fields we are interested in

    2. Webform tab to further tailor the Webform

      1. Webform Components - change the order and attributes of the fields

      2. Conditionals - not used in this simple Webform

      3. Form Validation - not used in this simple Webform

      4. e-Mails - not used in this simple Webform

      5. Form Settings - Configure aspects like progression bar, save as draft etc.

    3. View - You can view the progress of the Webform at any time

Each stage is described in more detail below.

1. Initial Webform creation

Go to the Self-Service Portal and navigate to Content -> Add Content -> Webform.

Note: If you do not see this menu option then ask your administrator to check your permissions.

You will see a "Create Webform" page where we complete some basic information about this new Webform:

  1. Title - is what will be shown to users of the Webform. Obviously it should be something meaningful so that you can easily understand its purpose.

  2. Form internal title - if you want you can provide a different name for the form that is used within CiviPlus.

  3. Revision Information - allows you to version control the Webform, so that you can track changes that may be made over the Webform's life and understand why they were made. Check the Create new revision option and enter a Revision log message if you want to use this feature. Once revisions are enabled, the system tracks each version of the form along with its respective changes. This allows administrators to:

    1. View all past versions of the form.

    2. Compare changes between versions.

    3. Revert to an older version if necessary, in case there’s an error or you want to restore a previous configuration.Authoring Information - allows you to provide details on the person (Authored by)and date (Authored on) that the Webform was created.

  4. Publishing Options - By default your form will be created as ‘published’ - to avoid it being accessed inadvertently until you have completed and tested it, you can deselect the Published checkbox so that it’s only available to non-staff members until you are happy it’s ready. (Note: You will be able to identify an unpublished form easily once you add fields, as the background will be pink.). The Promoted to Front Page and Sticky at Top of Lists options are not relevant for CiviPlus Webforms so you can ignore them.

Click the Save button to actually create the new Webform.

2. Webform Configuration Tabs

Once you save the Webform basic information you will see a page with various tabs that allow you to complete the Webform configuration. The purpose of each is described below:

  1. View - Displays the form in the same way that the user will see it.

  2. Edit - Allows you to view/change "basic" information you entered when you first created the Webform.

  3. Webform - Shows a number of other configuration tabs for the form:

    1. Form components - The various components that make up the Webform - fields, page breaks, HTML mark up areas and layout options.

    2. Conditionals - Allows you to specify whether a Form component gets shown or not depending on certain conditions. Please refer to the article on Complex Webforms to see how to configure this.

    3. Form validation - Allows you to specify validation of fields that takes place when the form is submitted. Please refer to the article on Complex Webforms to see how to configure this.

    4. e-Mails - Allows you to send an email to different users immediately upon submission of your form. Please refer to the article on Complex Webforms to see how to configure this.

    5. Form settings - Allows to configure various other aspects of the form, such as the submission confirmation messages, progress bar, saving drafts etc. This article only covers a few of the options on this tab, please refer to the article on Complex Webforms to understand how to configure the remainder.

  4. Results - When a Webform is submitted it is stored in the Portal CMS, as well as being sent to CiviPlus. The Results tab lets administrators view, delete and download results from submitted forms. Please refer to the article on Complex Webforms to see how to use this.

  5. CiviCRM - Allows you to turn on the integration between the Webform and the CiviPlus data fields. Once switched on you can select which CiviPlus fields you want to appear as a Webform component (see 3 above).

a. CiviCRM Tab

This is where you define how the Webform is going to interact with the CiviPlus system, and so it is often best to configure this tab first. When you check the Enable CiviCRM Processing option the left of the page page shows a number of different CiviPlus entities that you can configure. Depending on what types of data you want to collect with the Webform you might need to complete several of these sections, in our simple example we are only interested in the Contacts section.

A Webform can be associated with multiple contacts in CiviPlus, for example you may want to display/capture details of an individual and the organisation that they work for, in which case you would set the Number of Contacts to 2. Or perhaps you want to allow someone to enter details of up to five new individuals, in which case you would uld set the Number of Contacts to 6 (details of the person filling in the Webform plus five others). A separate Contact tab will be created on the left for each contact that needs to be configured, but in our example we can leave the Number of Contacts as 1 and so a single Contact tab will be shown.

Note: It is best practice to always use the first contact details for the person filling out the Webform.

By configuring the Contact page we can specify what fields are displayed on the Webform and how they are processed in CiviPlus when the submit button is clicked.

Contact Type

Different contact types will have different fields associated with them, and so we need to tell the Webform which type this contact is. In our example we select "Individual", but note that if we had chosen "Organisation" a different set of fields and options would be displayed.

Label

A generic label of "Contact 1" gets created by default, but it's best to replace this with something more meaningful as it will make the Webform easier to understand when configuring and displaying to the end user. . We will use "My Details" in this example.

Contact Fields

This is where we start to populate the Webform with fields from CiviPlus. Checking the Existing Contact option tells the Webform that the details we are about to complete belong to person who may already stored in CiviPlus, and so any changes or new fields should be recorded against this contact. It it turns out that the person is in fact not already known to CiviPlus then a new contact record will be created. First Name and Last Name are the minimum contact fields that you should select - but in you want to display and update any of the other "standard" contact fields then just select them as well. Current Employer is used when you want to show a contact's Organisation details as well as Indvidual details (as mentioned above, you would need to set Number of Contacts to more that one in order to do this) - in our simple example this is not needed.

Matching Rule

This is where you specify how CiviPlus is to handle recognising an existing contact to avoid duplications being stored. This is a whole topic in itself covered in this article , but luckily the "Default Unsupervised" rule will suffice in 99% of circumstances

Note: The Default Unsupervised Matching Rule refers to the criteria CiviPlus automatically uses without user intervention when matching contacts.

It typically compares the following fields: First Name, Last Name, Email Address to decide whether a contact already exists, or whether a new one needs to be created.

Number of Gift Aid Declaration Fields, Enable Tags and Groups Fields, Number of Address Fields, Number of Phone Fields

We will skip over these options as they are not necessary for our example. Suffice to say that if you wanted to include any of these field types on your Webform then choose the number of each you need and then select the individual fields you want displayed.

Number of Email Fields

This is an important option to select if we want the Matching Rule described above to work and avoid duplicates being created. We have already chosen the First Name and Last Name fields in the Contact Fields section, and by choosing to display the Primary Email field Location we can ensure that when submitted the Education and Certification Details will be recorded against the right contact.

Number of Website Fields, Number of Instant Message Fields, Enable Members Directory Information Fields, Number of Custom Insurance Fields

We will skip over these options as they are not necessary for our example.

Enable Education and Certification Details Fields

Finally we get to the part where we can select the contact custom fields are are interested in. When we choose "Yes" for this option we will see all of the fields in the Education and Certification Details field set previously created in CiviPlus and we can choose which ones we want to include in the Webform - all of them for this example.

The completed CiviCRM tab for our example is shown below.

b. Webform Tab

Once the CiviCRM tab has been completed and saved the CiviPlus fields get added to the Webform, which you can then further configure by visiting the Webform tab.

i. Form Components

Under Form Components you can see a list of the CiviPlus fields that will be displayed on the Webform. You can edit these fields and change aspect such as whether to show/ hide the field label, make it disabled or mandatory etc. Depending of the type of the field there can be some very sophisticated options available, such as default values determined by the relationships between fields, validation and so on.

You can also add additional components, such as HTML Markup for images and other rich text blocks, or page breaks, and the position of fields in the form can be adjusted by dragging vertically, or horizontally to move them in/out of field sets i.e. groups of fields.

Note: If you move or a field up or down, you must save the configuration with the save button at the bottom of screen or the change will not be permanent.

As an example of the sort of field configuration you can do, we are going to make a slight change to the Graduation Year field. Because this is a date field, by default the date picker will show a full calendar from which a particular date (dd/mm/yyyy) can be selected. We want the user to just pick a particular year, so we will edit the field so that this happens.

We go to the row in the list of fields that shows Graduation Year and click the Edit link.

Then, on the page that follows we find the section labelled Hide, and select Day and Month so that these will not be options that the user can choose.

Now we click the Save Component button at the bottom of the page to commit the change, and don't forget to click the Save button on the Form Components page itself if you have change the order of anything in the list.

.

There are a great many other things that you can can configure for each of the Webform components, so please refer to the article on Complex Webforms to see how to do this.

ii. Conditionals

The Conditionals tab allows you to create conditional logic for displaying or hiding specific form fields based on user inputs. This feature enables the Webform to dynamically adjust which fields are visible, depending on the data a user enters. By using conditionals, you can make your forms more interactive, streamlined, and relevant, only showing fields when certain conditions are met.

Please refer to the article on Complex Webforms to see how to configure this tab.

iii. Form Validation

The Form Validation tab allows you to set up rules and conditions to ensure that the data users input into the Webform meets specific requirements before submission. This helps to maintain the accuracy and integrity of the information being collected.

Please refer to the article on Complex Webforms to see how to configure this tab.

iv. E-Mails

The Emails tab allows you to configure automatic email notifications which are triggered when the Webform is submitted. This feature is designed to send emails either to users (such as form submitters) or to administrators when certain conditions are met.

Please refer to the article on Complex Webforms to see how to configure this tab.

v. Form Settings

The Form Settings tab contains various options that allow you to control the behavior, appearance, and functionality of the Webform itself. It helps customise how the form behaves for users when they interact with it and allows you to configure high-level settings related to submissions, security, and user experience.

For our example we are just going to make one configuration change from the default Form Settings. Since our Webform is so short we don't really need the Progress Bar, and so we will uncheck that option on the page and Save the Configuration.

Please refer to the article on Complex Webforms to see how to configure the remainder of this tab

Viewing the Webform

From within the Webform configuration page you can click the View tab to see what the Webform will look like. The url at the top of the page can be used to make the Webform accessible for anyone else - the page below shows what a registered user called Ali Farley might see. Note that Ali's name and email address have been automatically filled in so that when he clicks the Submit button the details he has entered will be automatically stored against his existing contact record in CiviPlus. If an anonymous use was completing the form then a new contact record would be created using the name and email details entered into the Webform.

Finally, this is the page that Ali will see once he has submitted the form.

Did this answer your question?