Look Up a Contact by Email Address
Build a form where the visitor types their email address and the form immediately shows the contact and account it matched in Autotask. The visitor confirms they are the right person before they finish the request, and your actions receive the matched details instead of guessing later.
Overview
| Piece | Purpose |
|---|---|
email field | The address the visitor types. |
Look up contact workflow | Queries Autotask for a contact with that address. |
contact_name field | Calculated. Shows the matched contact's first name. |
company_name field | Calculated. Shows the matched contact's account name. |
Related pages:
Before You Start
- Connect Autotask. See Autotask Connections.
- Create a form and give it a name. See Forms.
Step 1: Add the Email Field
Select the Input tab, then select Add Field.
| Field | Value |
|---|---|
| Name | email |
| Label | Your email address |
| Type | String |
| Required | Checked |
Select Save.
Step 2: Create the Lookup Workflow
Select the Pre-Submission Workflows tab, then select Add Workflow.
| Field | Value |
|---|---|
| Name | Look up contact |
| Run this workflow on | Field change |
| Recalculate when these fields change | email |
Select Add Action and add API: Query for One Object.
| Setting | Value |
|---|---|
| Store the results in variable | contact |
| Autotask Entity Type to Query | Contact |
| Query condition | EMailAddress equals {{input.email}} |
Leave Generate an exception if no results unchecked. An address with no match should leave the fields blank rather than fail the workflow.
Select Save Workflow. The tab now lists the properties the workflow produces, such as custom.contact.FirstName.
Step 3: Add the Calculated Fields
Return to the Input tab and select Add Field.
| Field | Value |
|---|---|
| Name | contact_name |
| Label | We found you as |
| Type | String |
| Populate this field with a Pre-Submission Workflow output | Checked |
| Pre-Submission Workflow | Look up contact |
| Property | custom.contact.FirstName |
Select Save, then add a second field the same way.
| Field | Value |
|---|---|
| Name | company_name |
| Label | Your company |
| Type | String |
| Populate this field with a Pre-Submission Workflow output | Checked |
| Pre-Submission Workflow | Look up contact |
| Property | custom.contact.Account.AccountName |
One workflow run fills both fields.
The Property list offers the properties the query returns. To show a combined value such as Ada Lovelace, add a Render Text and Store as Variable step to the workflow with the text {{custom.contact.FirstName}} {{custom.contact.LastName}}, store it as contactFullName, then map the field to custom.contactFullName.
Step 4: Use the Values in Your Actions
Select the Actions tab and build what the form should do on submission. The matched values are available as ordinary inputs:
{{input.contact_name}}{{input.company_name}}{{input.email}}
Save the form.
Step 5: Test It
- Select Test on the form and enter a known contact address, or open the public URL.
- Type the address, then click out of the field.
- The calculated fields show "Calculating…", then the matched contact and account.
If both fields stay blank, the address did not match a contact. Open the form attempt's history and expand its Pre-Submission Workflow entry in Execution Logs to see the query that ran.
Next Steps
- Show a warning field when no contact matched, using Conditional Visibility on a text field and a rule that checks the workflow property is empty.
- Require a match before submission with a submission condition set to Allow only if condition matches, where
Workflow: Look up contact / custom.contact.idis not empty.