# Salesforce

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://2599974655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRF6etABDVMr59RdpyGw%2Fuploads%2Fgit-blob-9b3f0f3d44aaf4a0643425d2ce3e03988f95d7d9%2Fthe-salesforce-data-operation-v184-0.png?alt=media)

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

## Use Cases

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

## Data Operation Properties

### Datasource

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 **Settings > Integrations**.

### Operation

The Salesforce operation to perform. This selection determines 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)

#### Object Type

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.

This property only applies to the **Create**, **Delete**, **Update** and **Find** operations.

#### Id

Expects type `text`.

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.

This property only applies to the **Update** and **Delete** operations.

#### Object Body / Update Body

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

This property only applies to the **Create** and **Update** operations.

#### Fields

Selects the fields on the Salesforce Object to be returned.&#x20;

_This field is optional._ If no value is entered, the Find operation will return the Id and Name of the Object.

This property only applies to the **Find** operation.

#### Sort By

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

This property only applies to the **Find** operation.

#### Sort Direction

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

This property only applies to the **Find** operation, and only if a value selected for **Sort By**.

#### Conditions

Sets conditions for finding records. Expects fields from the selected Object Type.

This property only applies to the **Find** operation.

#### Condition Behavior

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

This property only applies to the **Find** operation.

#### 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.

This property only applies to the **Query** operation.

## Run Results

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