> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bijection.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Salesforce CRM Analytics datasets

> Publish labelled salesforce crm analytics datasets observations on your app.

Mount [app-rest](https://docs.bijection.com/integrations/native-rest.md#mount-and-bind) and bind
`restEndpoint` to the Salesforce My Domain HTTPS origin and path `/services/data/v66.0/wave/datasets`. Seal a Salesforce Analytics read token as a bearer credential. Set `selection` to the API version in the bound path.

Bind the receiver and the mount under the same `data` label.
Initialize with `{ profile: { mode: "provider", provider: "salesforce-crm-analytics.datasets", selection: "v66.0", limit: 50 } }`.

Datasets upsert by `id`. The app extracts the `page` token from `nextPageUrl` for the same API path. The terminal page restarts the next sweep. Omitted datasets stay published. Salesforce manages datasets, queries and jobs.

Each response is limited to 36 KiB and at most 100 records or the smaller
configured limit. The connector requires the bundled parser artifact.

## Query statements

`@bijectionhq/library-connectors/salesforce-crm-analytics` declares SAQL and
CRM Analytics SQL statements. Their text is fixed in the deployed declaration
with its digest in the lock, and it never travels in a feed's terms. A
dataset is a handle, `salesforceCrmAnalyticsDataset({ id, version })` or
`({ name })`, never a name in the text; a SAQL statement needs pinned
versions. Both tags take `run = { api, provider }`, where `provider` is the
`statement` target of `statementProvider({ protocol: "crmAnalytics", endpoint, secret })`,
the gateway's `query_statements` target. Deploy installs each statement on
it by digest, and an uninstalled digest refuses `DigestUninstalled`.

``salesforceCrmAnalyticsSaql(run, { key, fields })`…` `` takes typed binds.
The provider renders each one as a single literal token with the revisioned
SAQL encoder. It then re-lexes the rendered text and sends nothing on a
mismatch (`RelexMismatch`). The pager is fixed text ordered by the key:
keyset paging by default, and offset paging only over pinned versions
(`OffsetUnpinned` otherwise). ``salesforceCrmAnalyticsSql(run, { key, fields })`…` ``
takes no binds and reads one bounded snapshot.

`bijection check` admits the text with the guest's SAQL or SQL parser. A
statement must be one read-only pipeline or `SELECT`, with every `load`,
`FROM` and `JOIN` a dataset handle (`RelationUndeclared`), binds only in
value positions, outputs equal to the declared columns, and no author
`order`, `offset` or `limit`. The typed default
(`salesforceCrmAnalyticsRelation` with `salesforceCrmAnalyticsTyped`) is
lowered at check by the guest's SAQL or CRM Analytics SQL module.
[Provider reference](https://developer.salesforce.com/docs/platform/crm-analytics/overview)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.