Zip Code Validation
This code will help you validation zip codes on submit from a form / survey. Use the custom code action in the GHL workflow.
// Retrieve the input parameters from GHL
const inputZip = inputData.contact_postal_code ? inputData.contact_postal_code.toString().trim() : ""; // Ensure it's a clean string
// Define the list of allowed ZIP codes
const validZipCodes = [
"12344", "12345", "12345"
];
// Function to check if the ZIP code exists in the list
function isValidZip(zip) {
return validZipCodes.includes(zip);
}
// Output result back to GHL
return {
is_valid: isValidZip(inputZip),
zip_code: inputZip
};
6
0 comments
Jace Nelson
6
Zip Code Validation
Assistable.ai
skool.com/assistable
We give you the most dominantly unfair advantage in the agency space. The most installed GoHighLevel AI ever.
Leaderboard (30-day)
Powered by