# Salesforce

Salesforce is a comprehensive platform offering cloud-based CRM solutions that facilitate sales, customer service, and marketing processes. It enables organizations to manage customer interactions, streamline operations, and leverage analytics for improved decision-making, all within a customizable and scalable environment.

ZBrain and Salesforce integration unlocks these comprehensive capabilities:

**Run Query (Advanced)**

Run a salesforce query

**Create Object (Advanced)**

Create new object

**Update Object (Advanced)**

Update object by Id

**Batch Upsert (Advanced)**

Batch upsert a record by external id

**Bulk Upsert (Advanced)**

Bulk upsert a record by external id

**Custom API Call**

Make a custom API call to a specific endpoint

### **How to Connect Salesforce to ZBrain Flow?** <a href="#how-to-connect-salesforce-to-zbrain-flow" id="how-to-connect-salesforce-to-zbrain-flow"></a>

To integrate Salesforce with ZBrain Flow, follow these steps to select and utilize the desired capabilities:

1. **Search for the Salesforce Component**: Search the Salesforce component within the ZBrain interface.
2. **Select the Required Capability**: Select the required element based on your need.

### **Additional Settings to Create Salesforce Connection** <a href="#additional-settings-to-create-salesforce-connection" id="additional-settings-to-create-salesforce-connection"></a>

* **Connection Name**: Name your connection, typically "Salesforce."
* **Environment**: Select the environment type, like Production or Development.
* **Authenticate**: Connect to your Salesforce account to authenticate and enable the integration.
* **Save:** Save connection.

### **Additional Settings to Run Query (Advanced)** <a href="#additional-settings-to-run-query-advanced" id="additional-settings-to-run-query-advanced"></a>

* **Connection**: Select your pre-established Salesforce connection.
* **Query**: Input your specific query to execute advanced data retrievals or operations within Salesforce's database.

### **Additional Settings to Create Object (Advanced)**  <a href="#additional-settings-to-create-object-advanced" id="additional-settings-to-create-object-advanced"></a>

* **Connection**: Select the Salesforce connection to authenticate the session for data insertion.
* **Object**: Choose the Salesforce object where the new data will be created (e.g., Lead, Opportunity).
* **Data**: Provide the JSON formatted data for the new object being created in Salesforce.

### **Additional Settings to Update Object (Advanced)**  <a href="#additional-settings-to-update-object-advanced" id="additional-settings-to-update-object-advanced"></a>

* **Connection**: Choose the Salesforce connection for accessing and modifying data.
* **Object**: Select the Salesforce object type that contains the record to be updated (e.g., Case, Account).
* **Id**: Input the unique identifier (ID) of the record you wish to update.
* **Data**: Enter the JSON formatted data with the fields and values that need to be updated.

### **Additional Settings to Batch Upsert (Advanced)**  <a href="#additional-settings-to-batch-upsert-advanced" id="additional-settings-to-batch-upsert-advanced"></a>

* **Connection**: Select your Salesforce connection to authenticate and establish a link for data operations.
* **Object**: Choose the specific Salesforce object (e.g., Account, Contact) you want to modify or add records to.
* **External Field**: Specify the field that Salesforce will use to determine if a record exists (typically a unique identifier or external ID).
* **Records**: Enter the data for new or existing records in JSON format to be upserted into the specified Salesforce object.

### **Additional Settings to Bulk Upsert (Advanced)**  <a href="#additional-settings-to-bulk-upsert-advanced" id="additional-settings-to-bulk-upsert-advanced"></a>

1. **Connection**: Choose the Salesforce connection to authenticate and enable data integration.
2. **Object**: Select the Salesforce object type to be targeted for the upsert operation (e.g., Contact, Account).
3. **External Field**: Specify the field in Salesforce that acts as an external identifier for the upsert operation.
4. **Records**: Upload a CSV file containing the records to be inserted or updated based on the external field identifier.

### **Additional Settings for** **Custom API Call** <a href="#additional-settings-for-custom-api-call" id="additional-settings-for-custom-api-call"></a>

1. **Connection**: Choose the Salesforce connection that will authenticate and facilitate the API call.
2. **Method**: Select the HTTP method (GET, POST, PUT, DELETE, etc.) to be used for the API request.
3. **Headers**: Define custom headers for the API request, such as content type or authentication tokens.
4. **Query Parameters**: Add parameters to refine the API request, such as filters or specific fields to retrieve.
5. **Body**: Input the payload for the API call, typically used with POST or PUT methods to send data.
6. **No Error on Failure**: Check this box if you want the process to continue even if the API call fails.
7. **Timeout**: Specify the duration in seconds before the API call times out.
