Table: salesforce_lead - Query Salesforce Leads using SQL
Salesforce Leads are a key resource in Salesforce, a customer relationship management solution. They represent potential sales opportunities and contain information about individuals or representatives of organizations who are interested in the product or service that the company offers. Leads can be converted into accounts, contacts, or opportunities when they are qualified.
Table Usage Guide
The salesforce_lead
table provides insights into Leads within Salesforce. As a sales manager or marketing professional, explore Lead-specific details through this table, including personal information, source, status, and associated company details. Utilize it to track and analyze potential sales opportunities, understand customer behavior, and plan targeted marketing strategies.
Important Notes
- If the
naming_convention
configuration argument is set toapi_native
, please see API Native Examples.
Examples
Basic info
Explore the various leads in your Salesforce system to understand their status and gain insights into their associated industries. This can assist in identifying potential conversion opportunities and assessing lead quality.
select id, name, company, email, industry, is_converted, rating, status, websitefrom salesforce_lead;
select id, name, company, email, industry, is_converted, rating, status, websitefrom salesforce_lead;
List number of leads by industry type
Analyze the distribution of leads across different industry sectors. This is beneficial for understanding which industries are more engaged with your business, aiding in strategic decision-making.
select count(*), industryfrom salesforce_leadgroup by industry;
select count(*), industryfrom salesforce_leadgroup by industry;
List number of leads by status
Determine the distribution of leads based on their status. This can provide insights into your sales pipeline and help pinpoint areas for improvement.
select count(*), statusfrom salesforce_leadgroup by status;
select count(*), statusfrom salesforce_leadgroup by status;
API Native Examples
If the naming_convention
config argument is set to api_native
, the table and column names will match Salesforce naming conventions.
Basic info (with API Native naming convention)
Discover the segments that are converted and their respective ratings in a particular industry. This can be used to pinpoint specific areas for potential business growth and improvement.
select "ID", "Name", "Industry", "IsConverted", "Rating", "Status", "Website"from "Lead";
select "ID", "Name", "Industry", "IsConverted", "Rating", "Status", "Website"from "Lead";
List number of leads by industry type (with API Native naming convention)
Determine the distribution of leads across various industry types. This can help in identifying which industries are more engaged with your services, enabling targeted marketing efforts.
select count(*), "Industry"from "Lead"group by "Industry";
select count(*), "Industry"from "Lead"group by "Industry";
List cold rated leads
Discover the segments that are identified as 'cold' leads in your business. This is useful to target specific marketing strategies to improve conversion rates.
select "ID", "Name", "Industry", "IsConverted", "Rating", "Status", "Website"from "Lead"where "Rating" = 'Cold';
select "ID", "Name", "Industry", "IsConverted", "Rating", "Status", "Website"from "Lead"where "Rating" = 'Cold';
List qualified leads
Explore which leads are qualified, allowing you to focus your efforts on potential customers who have been pre-identified as likely to convert. This can help streamline your sales process and improve efficiency.
select "ID", "Name", "Industry", "IsConverted", "Rating", "Status", "Website"from "Lead"where "Status" = 'Qualified';
select "ID", "Name", "Industry", "IsConverted", "Rating", "Status", "Website"from "Lead"where "Status" = 'Qualified';
Schema for salesforce_lead
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. | |
address | jsonb | Street address for the lead. | |
annual_revenue | double precision | Annual revenue for the lead's company. | |
company | text | The lead's company. | |
converted_date | timestamp with time zone | Date on which this lead was converted. | |
created_by_id | text | Id of the user who created the lead. | |
created_date | timestamp with time zone | Creation date and time of the lead. | |
text | The lead's email address. | ||
id | text | Unique identifier of the lead in Salesforce. | |
industry | text | Primary business of lead's company. | |
is_converted | boolean | Indicates whether the lead has been converted (true) or not (false). | |
last_modified_by_id | text | Id of the user who last changed the lead record. | |
last_modified_date | timestamp with time zone | Date and time of the last changes to lead record. | |
lead_source | text | Source of lead, for example, Advertisement, Partner, or Web. | |
name | text | Name of the lead, as displayed on lead detail page. | |
number_of_employees | bigint | Number of employees at the lead's company. | |
owner_id | text | Id of the assigned owner of the lead. | |
phone | text | Lead's primary phone number. | |
rating | text | Indicates value or prospect of the lead, for example, Hot, Warm, Cold. | |
status | text | Status of the lead, for example, Open, Contacted, Qualified. | |
website | text | URL of the lead's company's website. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- salesforce
You can pass the configuration to the command with the --config
argument:
steampipe_export_salesforce --config '<your_config>' salesforce_lead