Skip to content

Web Forms

Service request form

integration:
  name: "ServiceRequestForm"
  type: "webform"

  endpoint: "/forms/service-request"

  fields:
    - name: "company"
      type: "text"
      label: "Company name"
      required: true

    - name: "contact"
      type: "text"
      label: "Contact person"
      required: true

    - name: "phone"
      type: "tel"
      label: "Phone"
      required: true

    - name: "email"
      type: "email"
      label: "E-mail"
      required: true

    - name: "address"
      type: "text"
      label: "Site address"
      required: true

    - name: "description"
      type: "textarea"
      label: "Issue description"
      required: true

    - name: "photos"
      type: "file"
      label: "Photos"
      accept: "image/*"
      multiple: true
      maxSize: 10485760  # 10 MB

  processing:
    # Find or create account
    - action: "findOrCreateEntity"
      entity: "Account"
      match:
        name: "{company}"
      create:
        name: "{company}"
        type: "Customer"

    # Find or create contact
    - action: "findOrCreateEntity"
      entity: "Contact"
      match:
        emailAddress: "{email}"
      create:
        firstName: "{contact.split(' ')[0]}"
        lastName: "{contact.split(' ').slice(1).join(' ')}"
        emailAddress: "{email}"
        phoneNumber: "{phone}"
        accountId: "{account.id}"

    # Create Lead
    - action: "createEntity"
      entity: "Lead"
      data:
        name: "Web form - {company}"
        source: "WebForm"
        type: "Service"
        description: "{description}"
        accountId: "{account.id}"
        contactId: "{contact.id}"
        attachments: "{photos}"

    # Notification
    - action: "notify"
      to: "role:Dispatcher"
      template: "new_web_request"

  response:
    success:
      redirect: "/thank-you"
      message: "Thank you, your request has been received."

Field types

Type Description
text Text field
textarea Multiline field
email Email with validation
tel Phone number
file File upload
select Select box
checkbox Checkbox

➡️ Continue to Security.