Form Submission Trigger¶
Overview¶
The Form Submission trigger captures data when visitors submit forms on your website. This creates a seamless connection between your website and your automation workflows, enabling instant follow-ups, lead nurturing, and data processing.
When to use this trigger:
- Capture contact form submissions
- Process lead generation forms
- Handle registration forms
- Manage support ticket submissions
- Collect survey responses
- Process quote requests
Quick Start¶
- Create a new workflow
- Add a Form Submission trigger as the first task
- Copy the embed code provided
- Add the embed code to your website
- Configure form field mappings
- Save and enable the workflow
- Test by submitting your form
Setting Up Your Form¶
Step 1: Add the Embed Code¶
After creating your Form Submission trigger, you'll receive an embed code. This code must be added to your website.
Embed Code Example:
Where to add it:
- WordPress: Use a plugin like "Insert Headers and Footers" or add to your theme's
footer.php - HTML Website: Add before the closing
</body>tag - React/Vue/Angular: Import in your main component or index file
- Shopify: Add to theme's
theme.liquidfile
Step 2: Mark Your Forms¶
The embed code monitors your website for form submissions. To connect a form to your workflow, add a data attribute to your form:
<form data-basecloud-form="contact">
<input type="text" name="name" placeholder="Your Name" />
<input type="email" name="email" placeholder="Your Email" />
<textarea name="message" placeholder="Your Message"></textarea>
<button type="submit">Submit</button>
</form>
Key Points:
- Add
data-basecloud-form="identifier"to your<form>tag - The identifier helps you track which form was submitted
- Use descriptive identifiers like "contact", "quote", "registration"
Step 3: Configure Field Mappings¶
Map your form fields to BaseCloud data fields so you can use them in subsequent tasks.
Example Mapping:
| Form Field | BaseCloud Field | Description |
|---|---|---|
name |
Customer Name | Contact's full name |
email |
Email Address | Contact's email |
phone |
Phone Number | Contact's phone |
message |
Notes | Form message/inquiry |
company |
Company Name | Business name |
Form Integration Methods¶
Method 1: Standard HTML Forms¶
Works with any standard HTML form on your website.
<form data-basecloud-form="newsletter" action="#" method="POST">
<input type="email" name="email" required />
<button type="submit">Subscribe</button>
</form>
The embed code automatically intercepts the submission and sends data to your workflow.
Method 2: AJAX/JavaScript Forms¶
For forms that submit via AJAX, you can manually trigger the workflow:
// After your AJAX submission succeeds
BaseCloud.submitForm('newsletter', {
email: formData.email,
name: formData.name,
});
Method 3: Form Builder Integration¶
If you use form builders (Gravity Forms, Contact Form 7, Elementor), you can:
- Use their webhook/action hooks to send data to BaseCloud
- Or use the standard embed code if they generate standard forms
Outputs¶
| Field | Type | Example | Notes |
|---|---|---|---|
task_name |
string | Website contact form |
The name of the trigger task that fired. Always present — useful when several forms share a workflow. |
run |
boolean | true |
|
run_text |
string | Inbound data received and processed successfully. |
Every other field is whatever the form posted, spread across the top level of the output. A form
posting name, email and message produces {{task_<ID>_name}}, {{task_<ID>_email}} and
{{task_<ID>_message}}.
The rest of the output is the incoming payload
This trigger spreads the payload it received across the top level of its output, so the remaining field names come from the source, not from BaseCloud. Run the workflow once and read the task's OUTPUT panel to see exactly what arrived.
BaseCloud does not add metadata to a submission
There is no form_id, ip_address, user_agent, url or submitted_at unless your form
sends a field with that name. If you need the submission time, use a
Date Formatter, or add the value to the form itself.
Real-World Examples¶
Capture an enquiry into the CRM¶
Create the client when nobody matches¶
Form Submission
└─ Match to Client contact_email from the form
└─ If Statement run is false
└─ New Client create the record
Confirm to the person who submitted¶
Assign the enquiry fairly¶
Field names come from your form
Everything except task_name is whatever the form posted. Run it once and read the OUTPUT
panel to see the exact names.
Form Success Handling¶
Default Behavior¶
By default, after a successful submission:
- The form shows a success message: "Thank you! Your form has been submitted."
- The form can be submitted again (not disabled)
Custom Success Messages¶
You can customize the success message in the Form Submission trigger settings:
Redirect After Submission¶
To redirect users to a thank-you page, configure the redirect URL:
On-Page Confirmation¶
To show a custom element on success without redirect:
// Add this to your website
BaseCloud.onFormSuccess = function (formId, response) {
if (formId === 'contact') {
document.getElementById('success-message').style.display = 'block';
document.getElementById('contact-form').style.display = 'none';
}
};
Testing Your Form¶
Test Submission¶
- Fill out your form on your website
- Submit the form
- Check the workflow execution history
- Verify all form fields were captured correctly
- Test subsequent tasks (emails, CRM updates, etc.)
Common Test Scenarios¶
- Empty Fields: Test with some fields left blank
- Special Characters: Test with quotes, apostrophes, line breaks
- Long Text: Test with lengthy messages
- Email Format: Test with various email formats
- Phone Numbers: Test different phone formats
Best Practices¶
✅ Do's¶
- Validate on client-side: Use HTML5 validation (
required,type="email") before submission - Show loading states: Indicate when the form is being processed
- Provide clear feedback: Show success or error messages
- Use descriptive field names: Name fields clearly (e.g.,
customer_emailnot juste) - Test thoroughly: Submit test forms before going live
- Add honeypot fields: Include hidden fields to catch spam bots
- Consider data privacy: Add GDPR/privacy compliance notices
❌ Don'ts¶
- Don't submit sensitive data without SSL: Always use HTTPS
- Don't skip error handling: Handle network failures gracefully
- Don't forget to disable submit button: Prevent double submissions
- Don't collect unnecessary data: Only ask for what you need
- Don't forget mobile testing: Test forms on mobile devices
Troubleshooting¶
Form Submissions Not Triggering Workflow¶
Possible Causes:
- Embed code not added to website
data-basecloud-formattribute missing- JavaScript errors on page
- Workflow is disabled
- Ad blockers blocking the script
Solutions:
- Verify embed code is in your website HTML
- Check browser console for JavaScript errors
- Ensure
data-basecloud-formattribute is present - Confirm workflow toggle is ON
- Test with ad blocker disabled
Some Form Fields Not Captured¶
Possible Causes:
- Field name attribute missing
- Field name doesn't match mapping
- Field is disabled
Solutions:
- Ensure all inputs have
nameattributes - Check field mapping configuration
- Verify fields are enabled when form is submitted
Form Submits But No Data Appears¶
Possible Causes:
- Form submits before BaseCloud script loads
- Race condition with page redirects
Solutions:
- Ensure embed code is in
<head>or early in<body> - Add small delay before redirect:
form.addEventListener('submit', function (e) {
e.preventDefault();
// Submit to BaseCloud
setTimeout(() => {
// Then redirect or show success
}, 500);
});
Duplicate Submissions¶
Possible Causes:
- User clicking submit multiple times
- Form not being disabled after submission
Solutions:
- Disable submit button on first click:
- Add visual loading state to prevent multiple clicks
Advanced Features¶
Multi-Step Forms¶
For multi-step forms, you can:
- Submit partial data at each step using
BaseCloud.submitForm() - Or submit all data at the final step with all fields included
File Uploads¶
To handle file uploads:
- Use File task after Form Submission
- Send file URL in form submission
- Process file in subsequent task
Conditional Form Fields¶
If your form shows/hides fields based on user selections:
- Only submitted fields will be captured
- Use If tasks to handle optional fields
- Check if field exists before using it
CAPTCHA Integration¶
To add CAPTCHA verification:
- Add reCAPTCHA to your form
- Include CAPTCHA token in form submission
- Use Code task to verify token
- Use If task to stop workflow if verification fails
Frequently Asked Questions¶
Can I use this with WordPress forms?¶
Yes! Add the embed code to your WordPress site, then add data-basecloud-form="identifier" to your form element. Most form builders allow adding custom attributes.
Does this work with AJAX forms?¶
Yes, the embed code handles both standard and AJAX form submissions. For custom AJAX implementations, use the BaseCloud.submitForm() JavaScript function.
Can I have multiple forms on one page?¶
Absolutely! Use different data-basecloud-form identifiers for each form. You can either:
- Create separate workflows for each form
- Use one workflow with an If task to check
task_55123_form_id
What happens if the form is submitted while offline?¶
The submission will fail. You should implement your own retry logic or queue system if offline support is critical.
Can I prevent spam submissions?¶
Yes, use these techniques:
- Add honeypot fields (hidden fields that bots fill out)
- Add CAPTCHA verification
- Rate limit by IP address using Code task
- Validate email format using formatter tasks
How do I handle checkbox or radio button groups?¶
Checkboxes and radio buttons work like any other field:
- Radio buttons: Value of selected option
- Single checkbox: "on" if checked, not included if unchecked
- Checkbox group: Separate fields for each checkbox
Can I pre-fill form fields?¶
Yes, use standard HTML to pre-fill forms:
Is there a limit on form field count?¶
No hard limit, but keep forms concise for better user experience. If you need many fields, consider a multi-step form.
Can I track which marketing campaign led to the submission?¶
Yes! Add hidden fields to your form:
<input type="hidden" name="utm_source" value="google" /> <input type="hidden" name="utm_campaign" value="spring2024" />
These will be captured and available in your workflow.
Next Steps:
- Inbound Email - Trigger workflows from incoming emails
- Webhook In Trigger - Trigger workflows from external systems
- Match to Client Task - Find/update contact records