turbot/salesforce
steampipe plugin install salesforce

Table: salesforce_product - Query Salesforce Products using SQL

Salesforce Products are used to represent the items you sell. They can be goods, services, or digital content that are part of your business model. Products are typically associated with Opportunities or Quotes in Salesforce.

Table Usage Guide

The salesforce_product table provides insights into Products within Salesforce. As a Sales or Business Analyst, explore product-specific details through this table, including standard and custom fields. Utilize it to uncover information about products, such as their associated Opportunities or Quotes, and the verification of custom fields.

Important Notes

  • If the naming_convention configuration argument is set to api_native, please see API Native Examples.
  • If the naming_convention parameter is set to api_native in the config file, then the table and column names will match what’s in Salesforce. For instance, the query select id, name from salesforce_product would become select "ID", "Name" from "Product2".

Examples

Basic info

Explore which products in your Salesforce inventory are active and who created them. This information can be useful for auditing purposes and to understand the distribution of product responsibilities within your team.

select
id,
name,
family,
is_active,
created_by_id,
quantity_unit_of_measure,
stock_keeping_unit
from
salesforce_product;
select
id,
name,
family,
is_active,
created_by_id,
quantity_unit_of_measure,
stock_keeping_unit
from
salesforce_product;

List inactive products

Discover the segments that consist of inactive products in your Salesforce database. This can help you identify which products are not currently in use, allowing you to make informed decisions about inventory management and product offerings.

select
id,
name,
family,
is_active,
created_by_id,
quantity_unit_of_measure,
stock_keeping_unit
from
salesforce_product
where
not is_active;
select
id,
name,
family,
is_active,
created_by_id,
quantity_unit_of_measure,
stock_keeping_unit
from
salesforce_product
where
is_active = 0;

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)

Explore which products are active and in stock by assessing key attributes such as product ID, name, and family. This can help in managing inventory and understanding product performance.

select
"ID",
"Name",
"Family",
"IsActive",
"StockKeepingUnit"
from
"Product2";
select
"ID",
"Name",
"Family",
"IsActive",
"StockKeepingUnit"
from
"Product2";

List inactive products (with API Native naming convention)

Discover the segments that contain inactive products in the inventory to better manage stock and potentially discontinue or replenish certain items.

select
"ID",
"Name",
"Family",
"IsActive",
"StockKeepingUnit"
from
"Product2"
where
not "IsActive";
select
"ID",
"Name",
"Family",
"IsActive",
"StockKeepingUnit"
from
"Product2"
where
"IsActive" = 0;

Show archived products

Explore which products have been archived in your inventory, allowing you to keep track of items no longer actively sold or in circulation.

select
"ID",
"Name",
"Family",
"IsActive",
"StockKeepingUnit"
from
"Product2"
where
"IsArchived";
select
"ID",
"Name",
"Family",
"IsActive",
"StockKeepingUnit"
from
"Product2"
where
"IsArchived";

Show deleted products

Uncover the details of products that have been removed from your inventory. This is useful for tracking product lifecycle and managing stock levels effectively.

select
"ID",
"Name",
"Family",
"IsActive",
"StockKeepingUnit"
from
"Product2"
where
"IsDeleted";
select
"ID",
"Name",
"Family",
"IsActive",
"StockKeepingUnit"
from
"Product2"
where
"IsDeleted";

Schema for salesforce_product

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
created_by_idtextThe id of the user who created the product record, with the date and time of creation.
created_datetimestamp with time zoneDate and time of the creation of the product role record.
descriptiontextDescription of the product.
display_urltextURL leading to a specific version of a record in the linked external data source.
external_data_source_idtextThe id of the related external data source.
external_idtextThe unique identifier of a record in the linked external data source.
familytextName of the product family associated with this record.
idtextUnique identifier of the product in Salesforce.
is_activebooleanIndicates that the product is ready for use in a price book, opportunity, or quote, and whether you can see the product in views.
is_archivedbooleanDescribes whether the product is archived. The default value is false.
is_deletedbooleanIndicates whether the object has been moved to the Recycle Bin (true) or not (false).
last_modified_by_idtextId of the user who most recently changed the product record.
last_modified_datetimestamp with time zoneDate of most recent change in the product record.
last_referenced_datetimestamp with time zoneThe timestamp when the current user last viewed product record.
last_viewed_datetimestamp with time zoneThe timestamp when the current user last viewed this record. If this value is null, this record might only have been referenced (last_referenced_date) and not viewed by the current user.
nametextThe product's name.
product_codetextThe internal code or product number that you use to identify the product.
quantity_unit_of_measuretextUnit of the product—for example, kilograms, liters, or cases.
stock_keeping_unittextThe product's SKU, which can be used with or in place of the Product Code field.
system_modstamptextThe date and time when order record was last modified by a user or by an automated process.

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_product