Skip to main content

Hi There — I have a lead capture form that among some general questions, has a Yes/No question — “Do you want to book a Demo?” 

If “Yes”, I want the URL on the “Submit” button to go to a certain URL.

If “No”, I want the URL on the “Submit” button to go to the regular Thank You page (which it already does).

 

How can I accomplish this?

 

Thanks in advance :)

Hi ​@Hud_Rock 

Zap action: Formatter > Utilities > Lookup Table

Help: https://zapier.com/apps/formatter/help


Hi Troy — I’m not sure I follow how this helps me accomplish the above… Could you clarify?


@Hud_Rock 

What app are you using for the lead capture form?


The conditional logic probably needs to be on the form.

If the form builder doesn’t provide an option one way would be to set two submit buttons switched via javascript based on the value in the boolean field. 

If Yes Show submit button A, if No show submit button B.

Below is a rough idea from ChatGPT  to achieve the what you were looking for on the form. 
 

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dynamic Submit Button</title>
</head>
<body>
<form id="demoForm">
<label for="demoChoice">Do you want a demo?</label>
<select id="demoChoice" name="demoChoice" onchange="updateSubmitButton()">
<option value="" selected disabled>Select an option</option>
<option value="yes">Yes</option>
<option value="no">No</option>
</select>
<div id="submitContainer">
<!-- Submit button will be dynamically updated -->
</div>
</form>

<script>
function updateSubmitButton() {
const choice = document.getElementById('demoChoice').value;
const submitContainer = document.getElementById('submitContainer');

// Clear any existing buttons
submitContainer.innerHTML = '';

// Create a new submit button
const submitButton = document.createElement('button');
submitButton.type = 'submit';

if (choice === 'yes') {
submitButton.textContent = 'Send to Demo (URL A)';
submitButton.onclick = () => {
document.getElementById('demoForm').action = 'https://example.com/urlA';
};
} else if (choice === 'no') {
submitButton.textContent = 'Send to Info (URL B)';
submitButton.onclick = () => {
document.getElementById('demoForm').action = 'https://example.com/urlB';
};
}

// Append the new button to the form
submitContainer.appendChild(submitButton);
}
</script>
</body>
</html>

 


I’m using the native Zapier form.


My understanding is that Conditional Logic on Zapier Forms is not applied to the Submit button only to fields.

Your zap will need to filter based on the results after submission not before.


@Badger I can live with that! Do you know how I would do that? :)


@Hud_Rock You can use a Filter or a code block to achieve it.

A filter should be fine in this case as you have a binary choice. 

Look at the response from the form for you question and the choose the right information to set the filter condition.


If it gives you the response as yes or no true or false then use a condition like matches exactly (I think this is case sensitive so be careful).

From there you could send the request to book an appointment or not. 

You can learn more about Filters on Elena’s blog post here https://zapier.com/blog/filter-by-zapier-guide/

Hope that helps. Any questions do reach out. 


Reply