turbot/salesforce
steampipe plugin install salesforce

Table: salesforce_contact - Query Salesforce Contacts using SQL

Salesforce Contacts is a feature within Salesforce CRM that allows businesses to store and manage information about their customers. It provides a centralized way to keep track of customer details, including their contact information, associated accounts, and any activities or opportunities related to them. Salesforce Contacts helps businesses stay informed about their customer base and maintain strong relationships with them.

Table Usage Guide

The salesforce_contact table provides insights into Contacts within Salesforce CRM. As a sales representative or a customer relationship manager, explore contact-specific details through this table, including name, email, phone number, and associated account information. Utilize it to uncover information about contacts, such as those who are associated with specific accounts, the activities related to them, and their communication details.

Important Notes

  • If the naming_convention configuration argument is set to api_native, please see API Native Examples.

Examples

Basic info

Explore the basic information of your Salesforce contacts to understand their source, department, and role within their organization. This can help in tailoring communication and marketing strategies to each contact.

select
id,
name,
account_id,
email,
lead_source,
title,
department
from
salesforce_contact;
select
id,
name,
account_id,
email,
lead_source,
title,
department
from
salesforce_contact;

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 allow you to gain insights into your contact list, such as identifying the associated account and department for each contact, without delving into overly technical details.

select
"ID",
"Name",
"AccountID",
"Email",
"Department"
from
"Contact";
select
"ID",
"Name",
"AccountID",
"Email",
"Department"
from
"Contact";

List deleted contacts

Uncover the details of contacts that have been deleted from your database. This can be useful for auditing purposes or for retrieving lost information.

select
"ID",
"Name",
"AccountID",
"Email",
"Department"
from
"Contact"
where
"IsDeleted";
select
"ID",
"Name",
"AccountID",
"Email",
"Department"
from
"Contact"
where
"IsDeleted";

Show contacts created in last 30 days

Explore which contacts have been added within the past month. This can help you keep track of recent additions and ensure that no new contacts have been missed.

select
"ID",
"Name",
"AccountID",
"Email",
"Department"
from
"Contact"
where
"CreatedDate" <= now() - interval '30' day;
select
"ID",
"Name",
"AccountID",
"Email",
"Department"
from
"Contact"
where
"CreatedDate" <= datetime('now', '-30 day');

Schema for salesforce_contact

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
account_idtextID of the account that's the parent of this contact.
assistant_nametextThe Assistant's Name.
assistant_phonetextThe Assistant's Phone.
birthdatetimestamp with time zoneThe contact's birthdate.
clean_statustextIndicates the record's clean status.
created_by_idtextThe Created By ID.
created_datetimestamp with time zoneThe Created Date.
departmenttextThe contact's department.
descriptiontextThe description of the contact
emailtextThe contact's email address.
email_bounced_datetimestamp with time zoneIf bounce management is activated and an email sent to the contact bounces, the date and time of the bounce.
email_bounced_reasontextIf bounce management is activated and an email sent to the contact bounces, the reason for the bounce.
faxtextThe contact's fax number.
home_phonetextThe contact's home telephone number.
idtextID of the account that's the parent of this contact.
individual_idtextID of the data privacy record associated with this contact. This field is available if Data Protection and Privacy is enabled.
is_deletedbooleanIndicates whether the object has been moved to the Recycle Bin (true) or not (false).
is_email_bouncedbooleanIf bounce management is activated and an email is sent to a contact, indicates whether the email bounced (true) or not (false).
jigsawtextThe Data.com Key.
jigsaw_contact_idtextReferences the company's ID in Data.com. If an account has a value in this field, it means that the account was imported from Data.com.
last_activity_datetimestamp with time zoneValue is the most recent of either: Due date of the most recent event logged against the record. Due date of the most recently close task associated with the record.
last_cu_request_datetimestamp with time zoneThe Last Stay-in-Touch Request Date.
last_cu_update_datetimestamp with time zoneThe Last Stay-in-Touch Save Date.
last_modified_by_idtextThe Last Modified By ID.
last_modified_datetimestamp with time zoneThe Last Modified Date.
last_referenced_datetimestamp with time zoneThe timestamp when the current user last accessed this record, a record related to this record, or a list view.
last_viewed_datetimestamp with time zoneThe timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.
lead_sourcetextThe lead's source.
mailing_addressjsonbThe Mailing Address.
master_record_idtextIf this record was deleted as the result of a merge, this field contains the ID of the record that remains.
mobile_phonetextContact's mobile phone number.
nametextThe full name of the contact.
other_addressjsonbThe Other Address.
other_phonetextThe other phone of the contact.
owner_idtextThe ID of the owner of the account associated with this contact.
phonetextBuisness telephone number for the contact.
photo_urltextThe Photo URL.
reports_to_idtextThe Reports To ID.
sp_connection_nametextSteampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
system_modstamptimestamp with time zoneThe System Modstamp.
titletextTitle of the contact, such as CEO or Vice President.

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_contact