turbot/salesforce
steampipe plugin install salesforce

Table: salesforce_account_contact_role - Query Salesforce Account Contact Roles using SQL

Salesforce Account Contact Role is a feature within Salesforce that allows users to specify the role that a contact plays within an account. It provides a way to define and manage the relationships between contacts and accounts, offering insights into the hierarchy and responsibilities within an organization. Salesforce Account Contact Role is crucial for managing customer relationships and understanding the dynamics within an account.

Table Usage Guide

The salesforce_account_contact_role table offers insights into the roles of contacts within Salesforce accounts. As a Salesforce administrator or sales representative, you can use this table to understand the responsibilities and hierarchy of contacts within an account. This can help you manage customer relationships more effectively, identify key contacts, and understand the dynamics within an account.

Important Notes

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

Examples

Basic info

Explore the roles assigned to different contacts within various accounts. This can assist in identifying key contacts and their roles in each account, which is crucial for effective account management and communication strategies.

select
id,
account_id,
contact_id,
is_primary,
role
from
salesforce_account_contact_role;
select
id,
account_id,
contact_id,
is_primary,
role
from
salesforce_account_contact_role;

List primary account contact role

Explore which contact roles are primarily associated with specific accounts. This is useful for understanding the main points of contact for each account.

select
id,
account_id,
contact_id,
is_primary
from
salesforce_account_contact_role
where
is_primary;
select
id,
account_id,
contact_id,
is_primary
from
salesforce_account_contact_role
where
is_primary;

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)

Gain insights into the primary contacts associated with each account, which can be useful in understanding the account's key relationships and interactions.

select
"ID",
"AccountID",
"ContactID",
"IsPrimary"
from
"AccountContactRole";
select
"ID",
"AccountID",
"ContactID",
"IsPrimary"
from
"AccountContactRole";

List primary account contact role (with API Native naming convention)

Explore which contacts are designated as the primary point of contact for their respective accounts. This is particularly useful for focusing communication efforts and understanding the main contact for each account.

select
"ID",
"AccountID",
"ContactID",
"IsPrimary"
from
"AccountContactRole"
where
"IsPrimary";
select
"ID",
"AccountID",
"ContactID",
"IsPrimary"
from
"AccountContactRole"
where
"IsPrimary";

Show approver account contact roles

Identify the primary contacts who hold the 'Approver' role within an organization. This can be useful to understand who has the authority to approve actions or changes within the system.

select
"ID",
"AccountID",
"ContactID",
"IsPrimary",
"Role"
from
"AccountContactRole"
where
"Role" = 'Approver';
select
"ID",
"AccountID",
"ContactID",
"IsPrimary",
"Role"
from
"AccountContactRole"
where
"Role" = 'Approver';

Show account contact roles created in last 30 days

Identify recent changes in your account's contact roles to understand any alterations made within the past month.

select
"ID",
"AccountID",
"ContactID",
"IsPrimary",
"Role"
from
"AccountContactRole"
where
"CreatedDate" <= now() - interval '30' day;
select
"ID",
"AccountID",
"ContactID",
"IsPrimary",
"Role"
from
"AccountContactRole"
where
"CreatedDate" <= datetime('now', '-30 day');

Schema for salesforce_account_contact_role

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
account_idtextID of the Account.
contact_idtextID of the Contact associated with this account.
created_by_idtextId of the user who created contact role record.
created_datetimestamp with time zoneDate and time of the creation of the contact role record.
idtextUnique identifier of the account contact role in Salesforce.
is_primarybooleanSpecifies whether the Contact plays the primary role on the Account (true) or not (false). Note that each account has only one primary contact role.
last_modified_by_idtextId of the user who most recently changed the contact role record.
last_modified_datetimestamp with time zoneDate of most recent change in the contact role record.
roletextName of the role played by the Contact on this Account, such as Decision Maker, Approver, Buyer, and so on.
sp_connection_nametextSteampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.

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_account_contact_role