The Form Handler feature in Marketing Cloud Next (Growth & Advanced Edition) allows you to capture data from external forms and send it directly to Salesforce—without modifying the external form structure.
Capture data from external websites (or CloudPages)
Map it to Salesforce objects (Lead, Contact, etc.)
Trigger automation via Flow
Add spam protection
Redirect users after submission
To allow external form submissions, you must whitelist the domain.
Go to Setup
Search for CORS
Click New
Enter:
Origin URL Pattern
https://*.example.com
Must include http or https
No trailing slash
Wildcard * allowed only before subdomain
https://mcxkknz3m0zj3jqsxn4hm3dp3q-4.pub.sfmc-content.com
Add → Content → Form Handler
Click Add Content
Select Form Handler
Enter Name (e.g., LeadFormHandler)
Click Save
This is the most critical step.
Click Add Data Source
Select:
Object: Lead / Contact / Account / Prospect
For each field:
Select Salesforce field
Enter External Field Name
👉 This must match the HTML form name attribute exactly.
<input type="text" name="lastName">
External Field Name = lastName
Case-sensitive (lastName ≠ LastName)
No spaces allowed
Required fields must be mapped
Checkbox values:
true / false
Type
Format
Date
YYYY-MM-DD
Time
hh:mm:ss
DateTime
YYYY-MM-DDTHH:mm:ss.sssZ
2025-07-31T15:00:00.000+0530
💡 Tip: Use hidden fields to generate datetime on the frontend.
A hidden field that bots fill but users don’t.
Add Honeypot Field
Set External Field Name:
comments
<div class="honeypot">
<input type="text" name="comments">
</div>
If field has value → treat as spam
After submission, users should be redirected.
Success URL:
https://www.salesforce.com/
Error URL:
https://www.google.com/
Form Handler is NOT published directly
Flow activation publishes it
In Form Handler → Click New Flow
Open Flow Builder
Record creation element already added
You can add:
Consent creation
Email sending
Journey entry
Field updates
Click Activate
👉 This automatically publishes the Form Handler
Copy Tracking Script
Copy Form Attributes
1. Paste script before closing body tag:
</body>
2. Add attributes inside <form>:
<form data-uma-forms="true" method="post">
<form id="FORM_ID" data-uma-forms="true" method="post">
<input type="text" name="lastName" required>
<input type="text" name="firstName" required>
<input type="email" name="emailAddress" required>
<!-- Honeypot -->
<div style="display:none;">
<input type="text" name="comments">
</div>
<!-- Hidden Fields -->
<input type="hidden" name="CreatedDate">
<input type="hidden" name="LastModifiedDate">
<input type="hidden" name="Status" value="New">
<button type="submit">Submit</button>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const now = new Date().toISOString();
document.querySelector("input[name='CreatedDate']").value = now;
document.querySelector("input[name='LastModifiedDate']").value = now;
});
</script>
Open your external page (CloudPage or website)
Fill out form
Submit
Redirect to success page
Record created in Salesforce (Lead)
Issue
Cause
No record created
Field names mismatch
Flow not triggered
Not activated
CORS error
Domain not whitelisted
Date error
Incorrect format
Spam submissions
No honeypot
External Form → Form Handler → Flow → Salesforce Record → (Optional Journey)