The public schema contains data that does not belong to a specific product domain area, such as metadata about your Yext account.
Businesses
public.businesses
This view contains general information about your Yext account. Yext accounts that belong to an account tree can use the businesses view to query metadata across all accounts in the tree.
| Column | Data Type | Description |
|---|---|---|
business_id | NUMBER | The internal numeric identifier Yext assigns to an account. It can be used as a joining column with any other view included in Data Sharing. |
resource_name | VARCHAR | The external-facing identifier. For resellers, this is the reseller account ID. |
name | VARCHAR | The business name |
parent_business_id | NUMBER | The unique, internal-facing identifier Yext assigns to a business's parent Yext account, if applicable |
created_timestamp | TIMESTAMP_NTZ | The timestamp of when the business's Yext account was created |
country | VARCHAR | The country associated with the business |
Sample Queries
Fetch sub-account data by joining to the businesses view.
select
business_id,
entity_id,
date,
sum(profile_views) as profile_views,
sum(serp_impressions) as serp_impressions
from legacy_listings.agg_location_daily -- Select data from any Data Sharing view
join public.businesses using (business_id) -- Join with the businesses view to fetch the parent_business_id.
where date between 'yyyy-mm-dd' and 'yyyy-mm-dd'
and parent_business_id = 1234567 -- This allows you to get the data belonging to any child account with a given parent_business_id
group by 1,2,3Decode the business ID and get the business name for any query.
select
sites.creation_timestamp,
site_name,
concat('https://yext.com/s/', businesses.business_id, '/yextsites/', site_id) as site_link,
businesses.business_id,
name as account_name, -- Select the business name
site_id,
sites.repo_uuid,
hostname,
published_deploy_id
from prod_pages.public.sites
join prod_platform.public.businesses using (business_id)
where creation_timestamp > dateadd(month, -6, current_date)
order by 1 desc;