turbot/salesforce
steampipe plugin install salesforce

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 to api_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,
website
from
salesforce_lead;
select
id,
name,
company,
email,
industry,
is_converted,
rating,
status,
website
from
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(*),
industry
from
salesforce_lead
group by
industry;
select
count(*),
industry
from
salesforce_lead
group 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(*),
status
from
salesforce_lead
group by
status;
select
count(*),
status
from
salesforce_lead
group 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

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
addressjsonbStreet address for the lead.
annual_revenuedouble precisionAnnual revenue for the lead's company.
companytextThe lead's company.
converted_datetimestamp with time zoneDate on which this lead was converted.
created_by_idtextId of the user who created the lead.
created_datetimestamp with time zoneCreation date and time of the lead.
emailtextThe lead's email address.
idtextUnique identifier of the lead in Salesforce.
industrytextPrimary business of lead's company.
is_convertedbooleanIndicates whether the lead has been converted (true) or not (false).
last_modified_by_idtextId of the user who last changed the lead record.
last_modified_datetimestamp with time zoneDate and time of the last changes to lead record.
lead_sourcetextSource of lead, for example, Advertisement, Partner, or Web.
nametextName of the lead, as displayed on lead detail page.
number_of_employeesbigintNumber of employees at the lead's company.
owner_idtextId of the assigned owner of the lead.
phonetextLead's primary phone number.
ratingtextIndicates value or prospect of the lead, for example, Hot, Warm, Cold.
statustextStatus of the lead, for example, Open, Contacted, Qualified.
websitetextURL 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