Our organization uses Salesforce as its primary CRM tool, and in that, we use it to create lead records manually from the Lead object.
The sales team struggled to create multiple lead records daily, which distracted them from focusing on important leads and related tasks. Later, we decided to allow our customers to fill in the lead fields from the web themselves.
For that, we can use the Web-to-Lead feature in Salesforce, which generates Leads directly from our website without logging into the Salesforce Org, and allows leads to enter their details through a web form.
Here, I will explain Web-to-Lead in Salesforce and create a Web-to-Lead form in Salesforce.
Table of Contents
ToggleWeb-to-Lead in Salesforce
In Salesforce, the Web-to-Lead feature allows us to collect Lead data from our website. This feature enables us to create a Web Form that allows leads to fill it out by visiting their website. That information will be stored in the Salesforce Org as lead records.
The Web-to-Lead is likely the same as Web-to-Case. The Web-to-Lead includes the following features:
- We can add the required lead fields to the web form. In those fields, potential customers can fill in details such as their name, email, and phone number.
- When leads submit the web form, their information is saved in the Leads Object in the Org, and Salesforce sends an Auto-Response Email to the customer regarding the same.
- Then, our sales team can view these records, manage them, respond to them, and attempt to convert them into customers.
Create a Web-to-Lead Form in Salesforce
Here are the steps to enable web-to-lead and create a webpage, allowing us to create an HTML form for use on the website.
- Click on the Gare icon, then Set up, and in the Quick Find Box, search for Web-to-Lead.

- First, we need to enable Web-to-Lead Settings; for that, click the Edit button.

- Then, in the web-to-lead setting, click on the checkbox Web-to-Lead Enabled.
- Set Default Lead Creator: Clicking the lookup icon here displays the user list. You can set the User you want.
- You can select an Email Template you created or a standard email template according to your requirements. This email template is used to send response emails to customers when they submit the form.

- Now, click on the Create Web-to-Lead Form.
- Next, in the form, select the fields from the Available Fields that you want to display on the web form, allowing customers to fill in the information in those fields.
- In the URL Field, enter the URL so that when the customer submits the lead details, the current page should be redirected to the URL that you entered.
- Then, click on the Generate button.

- Copy all the generated HTML code and click the Finished button.

- Paste the copied HTML code into Notepad and save the code with the .html extension.

Proof of Concept:
- Open the saved file in the browser. You will see the form with some fields we selected to create a lead form on the browser.
- Now fill in the case details and submit the form.

- Then, navigate to the Leads tab, and you will see that the record has been created automatically with the details that we entered in the Web form.

- Also, the customer will get an email at the email address they entered in the web form. Salesforce sent this email as a response with the email template you selected in the web-to-lead.

This is how we can enable and generate a Website to create Lead records using Web-to-Lead in Salesforce.
Conclusion
Now, I hope you have an idea about Web-to-Lead in Salesforce. In that, we have seen what web-to-lead is and what its uses are. We have also seen how to enable and generate the web form so that customers can fill in the details without logging in to the Salesforce Org. I also explained how to create leads from web-to-lead in Salesforce.
You may also like to read the following articles:
- Auto Response Rules in Salesforce
- How to Create Lead Process in Salesforce
- Lead Conversion in Salesforce
- Web-to-Case in Salesforce

Shubham is a Certified Salesforce Developer with technical skills for Building applications using custom objects, approval processes, validation rule salesforce flows, and UI customization. He is proficient in writing Apex classes, triggers, controllers, Apex Batches, and bulk load APIs. I am also familiar with Visualforce Pages and Lighting Web Components. Read more | LinkedIn Profile