Register for a Free Account
Name
Email
Choose Password
Confirm Password

How to Build a Simple Contact Form

This tutorial walks you step by step through building a simple contact form for your website using Motion 2. It is also a good exercise for understanding how Motion 2 works on the back end. The form has First Name, Last Name, Email and Message fields. When an applicant submits it, the form sends an email notification to a group on the admin side that monitors these submissions, then redirects the user to the home page.

Create an entity

  1. Open CRM > Configuration.
  2. Under Entities, click Add Entity Group.
  3. Name the group (for example, Contact Form).
  4. Right-click the group you added and click Add Entity.
  5. Name the entity (for example, Contact Form Entities) and select the Is Repeatable checkbox.
  6. Right-click the entity you added and click Manage Fields.
  7. Click Add and select the type Text Area.
  8. Type Message in the Label field and click Save & Close.

Create a group that gets notifications for this form

  1. Open Users > Groups.
  2. Right-click the Groups folder and click New.
  3. Name it (for example, Form Admin) and click Save & Close.
  4. Add the people who will get the form notifications.

Create a workflow in Motion 2

Add the workflow and its roles

  1. Open Motion 2 > Workflows. Right-click Workflows and click Add Workflow.
  2. Name the workflow (for example, Contact Form). If the same person may submit the form more than once, turn on Allow Multiple. Otherwise, a second submission from the same email address is refused.
  3. On the right side of the window, right-click Primary and click Add Role.
  4. Name the role Applicant, mark it as the default (main) role, and click Save & Close.
  5. Right-click Secondary and click Add Role.
  6. Name the role (for example, Form Admin), select the user group Form Admin, and click Save & Close.
Note: Do not name the primary role "User". If you do, the form will not submit.

A Default status is created automatically with the workflow. To add more statuses, right-click the workflow (Contact Form) and click Manage Statuses.

Add the form task and its fields

  1. Right-click the workflow and click Add Task.
  2. Select Form as the Task Type, choose Applicant as the Assigned Role, name the task (for example, Contact Form), and type a Title.
  3. To hide the Cancel button, tick the Hide checkbox next to it in Task Buttons.
  4. Right-click the Contact Form task and click Manage Form Fields.
  5. Add a Person Fieldset, name it Applicant and choose the Applicant role. All CRM fields go inside this fieldset.
  6. Right-click the person fieldset and add Person Fields for First Name, Last Name and Email. Check the Required checkbox on each.
  7. Right-click the person fieldset and add an Entity Fieldset, selecting the Contact Form Entities entity.
  8. Right-click the entity fieldset, add an Entity Field and select Message. Click Save & Close, then close the window.

When you finish, the form fields look similar to this example from another contact form. Your fieldset and field names will differ.

Manage Form Fields window: a person fieldset with First Name, Last Name, Email and Phone, and a nested entity fieldset with Subject and Message

Note: The entity fieldset must sit inside the person fieldset. If it does not, the answers are not saved to the CRM record.

Add the notification and redirect triggers

  1. Right-click the Contact Form task and click Add Trigger.
  2. Select Task Completion for the Source field and Send Notification for the Action field. The trigger name fills in automatically.
  3. Set Apply To to Role, select Form Admin as the role, and type the Notification Subject you want.
  4. Click the Applicant variable on the right side of the window, then double-click firstname and lastname to add them to the notification body. Reword the body, for example: {$Applicant.0.firstname} {$Applicant.0.lastname} has submitted a form. Click Save & Close.
  5. Right-click the Contact Form task again and add another trigger.
  6. This time, select Task Completion for Source and Redirect for Action, then select the home page in the Site Page field. Click Save & Close.

Set up the module in Site Planner

  1. Open Site Planner.
  2. Right-click the Modules folder and click Add Item.
  3. Select Task Sequence in the Module field.
  4. Name it Contact Form and click Save.
  5. Select Contact Form for the Workflow.
  6. Select Contact Form for the Tasks.
  7. Select the home page as your Default Page and click Save & Close.

The contact form is now ready to be published on any page of your website. Before you share the page, test the form from a private browsing window. See Testing a Motion 2 Workflow and Removing Test Users.

Related guides