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 toapi_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 becomeselect "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_unitfrom salesforce_product;
select id, name, family, is_active, created_by_id, quantity_unit_of_measure, stock_keeping_unitfrom 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_unitfrom salesforce_productwhere not is_active;
select id, name, family, is_active, created_by_id, quantity_unit_of_measure, stock_keeping_unitfrom salesforce_productwhere 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
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. | |
created_by_id | text | The id of the user who created the product record, with the date and time of creation. | |
created_date | timestamp with time zone | Date and time of the creation of the product role record. | |
description | text | Description of the product. | |
display_url | text | URL leading to a specific version of a record in the linked external data source. | |
external_data_source_id | text | The id of the related external data source. | |
external_id | text | The unique identifier of a record in the linked external data source. | |
family | text | Name of the product family associated with this record. | |
id | text | Unique identifier of the product in Salesforce. | |
is_active | boolean | Indicates that the product is ready for use in a price book, opportunity, or quote, and whether you can see the product in views. | |
is_archived | boolean | Describes whether the product is archived. The default value is false. | |
is_deleted | boolean | Indicates whether the object has been moved to the Recycle Bin (true) or not (false). | |
last_modified_by_id | text | Id of the user who most recently changed the product record. | |
last_modified_date | timestamp with time zone | Date of most recent change in the product record. | |
last_referenced_date | timestamp with time zone | The timestamp when the current user last viewed product record. | |
last_viewed_date | timestamp with time zone | The 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. | |
name | text | The product's name. | |
product_code | text | The internal code or product number that you use to identify the product. | |
quantity_unit_of_measure | text | Unit of the product—for example, kilograms, liters, or cases. | |
stock_keeping_unit | text | The product's SKU, which can be used with or in place of the Product Code field. | |
system_modstamp | text | The 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