A Google Apps Script that automates Elementor form submissions by:
- Copying a preformatted "Client Intake Form" sheet.
- Creating a new sheet tab for each submission.
- Populating mapped fields from submitted data.
- Returning a simple HTML acknowledgment.
- Allowing offline testing with
DUMMY_DATA
andtestWebhook()
.
- Listens for POST submissions and GET health checks.
- Copies a template sheet for each new form submission.
- Maps form fields to specific cells in the template.
- Always returns HTTP 200 OK responses.
- Includes dummy data and test function for local testing.
- Open Google Apps Script.
- Create a new project.
- Copy and paste the provided code into
Code.gs
.
Update these constants at the top of the script:
const SPREADSHEET_ID = 'your-spreadsheet-id-here';
const TEMPLATE_SHEET_NAME = 'Client Intake Form';
const FIELD_MAP = {
'First Name': 'E5',
'Last Name': 'L5',
'Email': 'E11',
'Telephone': 'E9',
'Type of Event/Service': 'E13',
'No. of Guests': 'F17',
'Glasses Needed': 'L17',
'Hours of Service': 'L11',
'Event Date': 'F7',
'No. of Bartenders': 'F35'
};
- Go to Extensions → Apps Script → Deploy → New Deployment → Web App.
- Set:
- Execute as: Me
- Who has access: Anyone
- Deploy and copy the Web App URL.
- Open Elementor form settings.
- Add a Webhook action.
- Paste the Web App URL.
Run the testWebhook()
function in Apps Script editor to simulate a form submission.
Example dummy payload:
{
'First Name': 'Jane',
'Last Name': 'Doe',
'Email': '[email protected]',
'Telephone': '123-456-7890',
'Type of Event/Service': 'Corporate Function',
'No. of Guests': '50',
'Glasses Needed': 'Yes',
'Hours of Service': '4',
'Event Date': '2025-05-01',
'No. of Bartenders': '3'
}
File | Description |
---|---|
Code.gs |
Main webhook and sheet management script |
README.md |
Project documentation file |
- Form field names must exactly match the keys in
FIELD_MAP
. - Supports both
application/json
andapplication/x-www-form-urlencoded
form payloads. - Sheet names are sanitized to remove invalid characters and truncated if necessary.
This project is licensed under the MIT License.
Developed by Keron Lewis for MixersAnonymous TT to automate and simplify client intake.