Formcrafts - a form and survey platform for Salesforce, HubSpot, etc
  1. Templates
    1. All templates illustration
      All templates
    2. Application forms illustration
      Application forms
    3. Calculation forms illustration
      Calculation forms
    4. Lead generation forms illustration
      Lead generation forms
    5. Customer service illustration
      Customer service
    6. Evaluation forms illustration
      Evaluation forms
    7. Survey and feedback illustration
      Survey and feedback
    8. Operations forms illustration
      Operations forms
    9. Payment forms illustration
      Payment forms
    10. Booking and registration illustration
      Booking and registration
    11. Salesforce forms illustration
      Salesforce forms
    12. Other forms illustration
      Other forms
  2. Features
    1. 18 Form Fields illustration
      18 Form Fields
    2. 19 Integrations illustration
      19 Integrations
    3. Conditional Logic illustration
      Conditional Logic
    4. Multi-step Forms illustration
      Multi-step Forms
    5. Calculations illustration
      Calculations
    6. Partial Submissions illustration
      Partial Submissions
    7. Save & Resume illustration
      Save & Resume
    8. Payments illustration
      Payments
    9. Hidden Fields illustration
      Hidden Fields
    10. Dynamic Dropdowns illustration
      Dynamic Dropdowns
    11. Engagement analysis illustration
      Engagement analysis
    12. Multilingual forms illustration
      Multilingual forms
  3. Pricing
  4. Help
  5. Login
  6. Signup
    →
  • Help index
  • Features
    • Conditional logic
    • Prefill forms
    • Multi-step forms
    • Calculations
    • Partial submissions
    • Field references
    • Save and resume
    • Hidden fields
    • Dynamic lookup
    • Workflows
    • Dynamic dropdowns
    • Multilingual forms
    • Privacy mode
    • Success message
    • Form redirect
    • GA/GTM
    • Accept payments
    • Linked forms
    • Disable form
  • Styling
    • Custom CSS
    • Custom fonts
    • Color scheme
    • Form background
  • Analytics
    • Test mode
    • Overview
    • Field analytics
    • Form engagement
  • Workflows
    • Send emails
    • Form redirect
    • Success message
    • Webhooks
    • Create PDF
    • ActiveCampaign
    • Asana
    • Mailchimp
    • Front app
    • Freshdesk
    • Google Sheets
    • Pipedrive
    • Linear
    • Klaviyo
  • Sharing
    • Custom form link
    • Embed on a page (inline)
    • Embed on a page (popup)
    • Embed in emails
    • Embed on WordPress
    • Embed on Shopify
    • Embed on Squarespace
  • Salesforce
    • Overview
    • Create records
    • Update records
    • Related records
    • Dynamic picklists
    • Attach files
    • Create PDFs
    • Form prefill
  • HubSpot
    • Overview
    • Create contact form
    • Create lead capture form
    • Create customer survey
    • Prefill HubSpot form
    • Embed on HubSpot page
    • Uninstall
  • Zendesk
    • Create ticket form
    • Create CSAT survey
    • Embed on Help Center
    • Prefill ticket form
  • Admin
    • Users
    • Custom domain
    • Vanity subdomain
    • Subscription
  • Developers
    • Embed Library
    • API keys
    • API v1
    • API v2
  • Others
    • Partner program
    • GDPR compliance
    • Workflow logs
    • White labeling
    • Form speed
    • Zapier
    • Migration
  • Contact
  1. Help
  2. ›
    Zendesk
  3. ›
    Prefill ticket form

Prefill Zendesk Form Fields

On this page
  1. Introduction
  2. Create a form
  3. Lookup ticket
  4. Prefill form fields
  5. Update ticket
  6. Notes

Introduction

Prefilling a form allows you to pre-populate your ticket form with data from an existing Zendesk ticket. There are two ways to prefill a form with ticket data from Zendesk:

Static prefill: Prefill data on form load using URL parameters.

Dynamic prefill: Prefill data based on user input to implement a search-like functionality.

Let us create a form that allows a user to update some ticket properties, and then add a new comment to the ticket.

Create a form

On your Formcrafts dashboard ↗ click on Add Form → Start from scratch. Enter a Form name and hit enter. This will create a new form.

You can also create a new form by clicking on Add Form → Use a Template and selecting a template. This would allow you to skip this step. We have a large collection of customer support form templates ↗ that you can use.

Now add some basic fields to your form using the Add field button on the top-left corner of the form editor:

  1. ticket_id (Hidden)
  2. Your name (One line text)
  3. Ticket subject (Email)
  4. Priority (Multiple choice)
  5. Comments (Comment)
Form editor with an Zendesk update ticket form

Hidden fields can be prefilled using URL parameters. So if you want to prefill the hidden field with the ID 12345 you can share your form using a link like:

app.formcrafts.com/my-form?ticket_id=12345

Learn more about using hidden fields and form prefill via URL.

Lookup ticket

In this step we will use the hidden field’s value to fetch the ticket data from Zendesk.

Click on the Lookups button on the top-left corner of the form editor, and then click on the Add lookup button.

Edit the new lookup, and under (select source) find Zendesk, and click on Connect to Zendesk.

Connect to Zendesk account

This will open a popup window where you can connect to your Zendesk account.

Next, under Lookup rules map Ticket ID to the ticket_id field in your form. Under Ticket properties select the ticket properties that you want to fetch. In this case, we are fetching the requester name, subject, and priority. Our lookup rule looks like this:

Zendesk ticket lookup based on hidden field
Zendesk ticket lookup based on hidden field

This lookup rule is configured to fetch a Zendesk ticket where the Ticket ID matches the value of ticket_id field (which is a hidden field populated via a URL parameter).

This tutorial uses ticket ID as the lookup rule. You can add additional rules using Add condition. Example, you can lookup tickets based on ticket ID and requester email. This method also assures a higher level of security.

Prefill form fields

Our form is configured to lookup the record. The last step is to use the ticket properties from this lookup to prefill the form fields.

Edit the Your name field, and under Prefill value type in @. This will open the references dialog. Find and select Requester name under Zendesk lookup references.

Zendesk prefill requester name field based on lookup
Prefill requester name field based on lookup

Do the same for other form fields - Subject and Priority.

Now click on Preview to open the form in a new tab. Edit the URL and add &ticket_id=xxxxxxx at the end, with a valid ticket ID. It should prefill the form with the ticket data.

Prefill Zendesk ticket form via URL parameters

Update ticket

We have successfully prefilled the form with ticket data. The last step is to create a workflow which will update the ticket in Zendesk when the form is submitted.

Click on the Workflows button on the top-left corner of the form editor, and then click on the Add workflow button.

Now edit the new workflow, and click on Add action. Under (select action) find Zendesk, and click on Connect to Zendesk.

Configure the action to Update a ticket, and create field mappings between the form fields and the ticket fields in Zendesk.

Workflow to update a Zendesk ticket

This workflow action will find a ticket with the given ticket ID, and update ticket properties. Note that comments are added to the ticket, not updated.

Notes

In the above example we prefilled the form using data available to us when the form loads, i.e. the contact ID in the URL. We can also prefill the form based on user input. We call this dynamic prefill.

The lookup conditions reference a hidden field in the form. Instead, you can create a picklist field, or a one line text field, and use the value of this field to fetch the ticket record.

Formcrafts will watch this field for changes, and automatically update the lookup results.

Minimal, fast, and powerful. Try now.
Formcrafts - a form and survey platform for Salesforce, HubSpot, etc

Subtle Web Inc,
225 Railway St E,
T4C 2C3, Cochrane AB

Salesforce AppExchange partner logo HubSpot app partner logo
Templates
Application formsLead generation formsSurvey & feedback formsEvaluation formsSupport request formsBooking & registrationContact forms
Comparisons
vs AllFormAssemblyTypeformJotformWufooSurveyMonkey
Features
Conditional logicSalesforce formsHubSpot formsZendesk ticket formsEmail formsIntegrationsForm fields
Resources
Help centerBlogDeveloper APIGDPRStatusReport abuseContact us
Company
About usNonprofitCase studiesSecurityTerms and privacy