# Salesforce

### The Salesforce Data Operation

The **Salesforce** Data Operation makes a request to your specified Salesforce Instance's API. It has many uses, including querying, creating, editing and deleting Salesforce objects.

![organizing info](https://1191388742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhOn9CLWoV9VfJeM5EDAa%2Fuploads%2Fgit-blob-9b3f0f3d44aaf4a0643425d2ce3e03988f95d7d9%2Fthe-salesforce-data-operation-v1715-0.png?alt=media)

Using a Salesforce Data Operation requires [setting up your connection to Salesforce.](../building-apps/integration-guides/create-a-salesforce-lead)

### Use Cases

* Create a contact record in Salesforce from information filled out on an Airkit form
* Allow a customer to delete their information from your mailing list by deleting a record Salesforce
* Allow a customer to change their communication preferences by updating a record in Salesforce

### Data Operation Properties

#### Datasource

Selects the Salesforce Instance to perform the Data Operation on. The dropdown options are populated by the list of integrated Salesforce Instances in your Airkit App under **Configuration Builder > Integrations**.

&#x20;

#### Operation

Selects the Salesforce operation to perform. This selection will determine the other required fields to be defined to perform the operation.

The available operations are:

* Create records (Create a new record in Salesforce)
* Delete records (Deletes a record in Salesforce)
* Update records (Updates a record in Salesforce)
* Find records (Finds records in Salesforce of a type with conditions)
* Query records (Query records)

&#x20;

#### Object Type (Create, Delete, Update, Find)

Selects the Salesforce Object for the Operation to be performed.  The dropdown list provided to you is populated by the Salesforce Objects that are defined in your connected Salesforce Instance.

&#x20;

#### Id (Update, Delete)

Defines the Salesforce ID of the Salesforce Object to be updated or deleted.  For Object Updates, an expression can be entered. Object Deletion requires the String of the ID to be inputted explicitly.

&#x20;

#### Object Body / Update Body (Create, Update)

Selects the fields on the Salesforce Object to be updated/created which can then be passed a value for update/creation.

#### Fields (Find)

Selects the fields on the Salesforce Object to be returned.  If no value is entered, the Find operation will return the Id and Name of the Object. _This field is optional._

&#x20;

#### Sort By (Find)

Controls the order of the returned results. _This field is optional._

&#x20;

#### Sort Direction (Find)

Controls the order of the returned results. _This field is optional._

&#x20;

#### Conditions (Find)

Sets conditions for finding records. Expects fields from the Object Type to be selected&#x20;

&#x20;

#### Condition Behavior (Find)

Sets whether all or any of the **Conditions** set are required to be met to find the Salesforce Object.

&#x20;

#### Query (Query)

Expects a string with the [SOQL](https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql.htm) query to search for Salesforce records.

#### Run Results (Create, Delete, Update, Find, Query)

By default, Airkit creates a variable on the Connection called "Salesforce" and can then be passed into subsequent operations.
