> For the complete documentation index, see [llms.txt](https://docs.jigx.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.jigx.com/building-apps-with-jigx/data/data-providers/salesforce/using-the-salesforce-provider.md).

# Using the Salesforce provider

When working with the Salesforce provider, it is helpful to know how to reference more than one Salesforce object at a time, filter the columns you require, join data from different objects, and use it in a jig. Below are code examples of each.

### Using IntelliSense

In the Salesforce provider, use IntelliSense (ctrl+space) in the `entities` properties to select objects from the standard Salesforce objects or start typing the name of the object, and the list will provide you with a selection. When using custom objects, you need to manually type in the name. A blue line will display under the name, this indicates that it is an unknown Salesforce entity, and you can ignore the warning if it is a custom object

<figure><img src="/files/R3jwqYstnR5DLne37OKU" alt="IntelliSense in Salesforce provide"><figcaption><p>IntelliSense in Salesforce provider</p></figcaption></figure>

### Referencing multiple objects in a jig

Below is an example of syncing data from six Salesforce objects when the jig is `onFocus`, using `action.sync-entities`.

{% code title="multiple-objects" %}

```yaml
onFocus:
  type: action.action-list
  options:
    actions:
      - type: action.sync-entities
        options:
          provider: DATA_PROVIDER_SALESFORCE
          entities:
            - Account
            - Opportunity
            - OpportunityStage
            - User
            - UserRole
            - Territory
```

{% endcode %}

### Filtering columns

{% columns %}
{% column %}
Below is a simple example of filtering the Account object's name column to only return accounts starting with the letter A.
{% endcolumn %}

{% column %}

<figure><img src="/files/nK2if7rQWdEmJTg58umA" alt="Accounts starting with A" width="188"><figcaption><p>Accounts starting with A</p></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

{% code title="filter-query" %}

```yaml
title: Accounts starting with A
type: jig.list
icon: contact

header:
  type: component.jig-header
  options:
    height: medium
    children:
      type: component.image
      options:
        source:
          uri: https://images.unsplash.com/photo-1577974291737-faf660945d53?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2674&q=80

onFocus:
  type: action.action-list
  options:
    actions:
      - type: action.sync-entities
        options:
          provider: DATA_PROVIDER_SALESFORCE
          entities:
            - Account

datasources:
  filter-account:
    type: datasource.sqlite
    options:
      provider: DATA_PROVIDER_LOCAL

      entities:
        - entity: Account
      # filter the account object to return specific columns and a select number of rows
      query: SELECT id, '$.Name', '$.BillingCountry' FROM [Account] WHERE '$.Name' LIKE 'a%'

data: =@ctx.datasources.filter-account
item:
  type: component.list-item
  options:
    title: =@ctx.current.item.Name
    subtitle: =@ctx.current.item.BillingCountry
```

{% endcode %}

### Joining data

Below is an example of how you join data from multiple objects in Salesforce using SQLite queries. In this example we joining data in the Account and Case objects.

{% code title="join-data" %}

```yaml
query: SELECT id as accid, '$.Name', '$.BillingCountry' FROM [Account]
  LEFT JOIN [Case]
  on AccountId = accid
  group by casepriority = caseprior
```

{% endcode %}

### Examples and code snippets

The following examples with code snippets are provided:

* [Create records in objects](https://docs.jigx.com/examples/readme/data-providers/salesforce/create-records-in-objects)
* [Delete records in objects](https://docs.jigx.com/examples/readme/data-providers/salesforce/delete-records-in-objects)
* [Save & update records in objects](https://docs.jigx.com/examples/readme/data-providers/salesforce/save-and-update-records-in-objects)
* [List records in objects](https://docs.jigx.com/examples/readme/data-providers/salesforce/list-records-in-objects)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.jigx.com/building-apps-with-jigx/data/data-providers/salesforce/using-the-salesforce-provider.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
