Salesforce
Create records, run queries, and manage objects in Salesforce CRM.
On this page
- Connect
- Call it from a workflow
- Actions (27)
- create_record
- run_query
- update_record
- add_contact_to_campaign
- add_file_to_record
- add_lead_to_campaign
- create_attachment
- create_case
- create_contact
- create_lead
- create_note
- create_opportunity
- create_task
- custom_api_call
- delete_opportunity
- delete_record
- export_report
- find_child_records
- find_record
- find_records_by_query
- get_record_attachments
- run_report
- send_email
- update_contact
- update_lead
- upsert_by_external_id
- upsert_by_external_id_bulk
- Details
Connect
Auth type: OAuth (oauth2). Click Connect and approve access on the provider's page. Appbricx runs the OAuth flow (signed single-use state, PKCE where the provider supports it), stores the tokens encrypted and refreshes them before they expire.
Scopes requested: apirefresh_token
OAuth needs an OAuth app: the platform's when the operator configured one, or your own (admin panel, Integrations, Configure). You can also bring your own credentials.
- In the editor: Backend panel, Integrations tab, then Connect. This connects it for the project.
- For every project in a workspace: Workspace settings, Integrations.
- Owners and admins choose which integrations members may connect in the admin panel (Integrations tab), and can attach their own OAuth app there.
Call it from a workflow
Pass the action name and its input. The call resolves with { success, output, error? }; a missing connection resolves with success false and the reason. See ctx.integrations.invoke and ctx.integrations.call.
// .workflow.js (native ctx)
export async function run(ctx) {
const res = await ctx.integrations.invoke("salesforce", "create_record", {
"object": "<object>",
"data": {}
});
if (!res.success) throw new Error(res.error);
ctx.log.info("Salesforce answered", { output: res.output });
}// defineWorkflow module (@app/sdk ctx)
import { defineWorkflow } from "@app/sdk";
export default defineWorkflow({
id: "salesforce-create-record",
name: "Salesforce: Create Record",
description: "Calls Salesforce when a row is created.",
trigger: { type: "entity_event", entity: "tickets", event: "created" },
async run(ctx, event) {
const res = await ctx.integrations.call("salesforce", {
"action": "create_record",
"object": "<object>",
"data": {}
}) as { success: boolean; error?: string };
if (!res.success) throw new Error(res.error);
},
});curl -X POST "$APP_ORIGIN/__appbricx/connector-proxy/salesforce/create_record" \
-H "Authorization: Bearer $APP_KEY" \
-H "content-type: application/json" \
-d '{"props":{"object":"<object>","data":{}}}'Actions
create_recordin catalog
Create Record. Create a record of a given object.
| Input | Type | Description |
|---|---|---|
objectrequired | id (picked from your account) | Select the Object |
datarequired | JSON | Enter the fields for the new record as a JSON object. For example: {"Name": "My New Account", "Industry": "Technology"} |
run_queryin catalog
Run Query (Advanced). Run a salesforce query
Also accepted as query.
| Input | Type | Description |
|---|---|---|
queryrequired | text | Enter the query |
update_recordin catalog
Update Record. Updates an existing record.
| Input | Type | Description |
|---|---|---|
objectrequired | id (picked from your account) | Select the Object |
record_idrequired | id (picked from your account) | The record to select. The list shows the 20 most recently created records. |
datarequired | JSON | Enter the fields to update as a JSON object. For example: {"BillingCity": "San Francisco"} |
add_contact_to_campaign
Add Contact to Campaign. Add a contact to a campaign.
| Input | Type | Description |
|---|---|---|
campaign_idrequired | id (picked from your account) | Campaign |
contact_idrequired | id (picked from your account) | Contact |
statusrequired | id (picked from your account) | The campaign member status (e.g., 'Sent', 'Responded'). |
add_file_to_record
Add File to Record. Uploads a file and attaches it to an existing record.
| Input | Type | Description |
|---|---|---|
objectrequired | id (picked from your account) | Select the Object |
record_idrequired | id (picked from your account) | The record to select. The list shows the 20 most recently created records. |
filerequired | file | The file to upload. |
file_namerequired | text | The name of the file, including its extension (e.g., "report.pdf"). |
add_lead_to_campaign
Add Lead to Campaign. Adds an existing lead to an existing campaign.
| Input | Type | Description |
|---|---|---|
campaign_idrequired | id (picked from your account) | Campaign |
lead_idrequired | id (picked from your account) | Lead |
statusrequired | id (picked from your account) | The campaign member status (e.g., 'Sent', 'Responded'). |
create_attachment
Create Attachment (Legacy). Creates a legacy Attachment record. Salesforce recommends using "Add File to Record" for modern apps.
| Input | Type | Description |
|---|---|---|
objectrequired | id (picked from your account) | Select the Object |
parent_idrequired | id (picked from your account) | The record to select. The list shows the 20 most recently created records. |
filerequired | file | The file to attach. |
file_namerequired | text | The name of the file, including its extension (e.g., "attachment.pdf"). |
create_case
Create Case. Creates a Case, which represents a customer issue or problem.
| Input | Type | Description |
|---|---|---|
Subjectrequired | text | Subject |
Descriptionoptional | long text | Description |
Statusoptional | id (picked from your account) | Status |
Priorityoptional | id (picked from your account) | Priority |
Originoptional | id (picked from your account) | Origin |
AccountIdoptional | id (picked from your account) | Account |
ContactIdoptional | id (picked from your account) | Contact |
other_fieldsoptional | JSON | Enter additional fields as a JSON object. |
create_contact
Create Contact. Creates a new contact record.
| Input | Type | Description |
|---|---|---|
LastNamerequired | text | Last Name |
FirstNameoptional | text | First Name |
AccountIdoptional | id (picked from your account) | Account |
Emailoptional | text | |
Phoneoptional | text | Phone |
Titleoptional | text | Title |
other_fieldsoptional | JSON | Enter additional fields as a JSON object. |
create_lead
Create Lead. Creates a new lead.
| Input | Type | Description |
|---|---|---|
LastNamerequired | text | Last Name |
Companyrequired | text | Company |
FirstNameoptional | text | First Name |
Emailoptional | text | |
Phoneoptional | text | Phone |
LeadSourceoptional | id (picked from your account) | Lead Source |
other_fieldsoptional | JSON | Enter additional fields as a JSON object (e.g., {"Title": "Manager", "Website": "http://example.com"}). |
create_note
Create Note. Creates a note and attaches it to a record.
| Input | Type | Description |
|---|---|---|
objectrequired | id (picked from your account) | Select the Object |
parent_idrequired | id (picked from your account) | The record to select. The list shows the 20 most recently created records. |
Titlerequired | text | Title |
Bodyrequired | long text | The content of the note. |
create_opportunity
Create Opportunity. Creates a new opportunity.
| Input | Type | Description |
|---|---|---|
Namerequired | text | Name |
CloseDaterequired | text | The expected close date in YYYY-MM-DD format. |
StageNamerequired | id (picked from your account) | Stage |
AccountIdoptional | id (picked from your account) | Account |
Amountoptional | number | Amount |
other_fieldsoptional | JSON | Enter additional fields as a JSON object. |
create_task
Create Task. Creates a new task.
| Input | Type | Description |
|---|---|---|
Subjectrequired | text | Subject |
OwnerIdrequired | id (picked from your account) | The owner of the task. |
Statusrequired | id (picked from your account) | Status |
Priorityrequired | id (picked from your account) | Priority |
Descriptionoptional | long text | Description |
WhoIdoptional | text | The ID of a Contact or Lead to relate the task to. |
WhatIdoptional | text | The ID of an Account, Opportunity, or other object to relate the task to. |
custom_api_call
Custom API Call. Make a custom API call to a specific endpoint
| Input | Type | Description |
|---|---|---|
urlrequired | object (depends on other props) | url |
methodrequired | one of "GET" | "POST" | "PATCH" | "PUT" | "DELETE" | "HEAD" | Method |
headersrequired | object | Authorization headers are injected automatically from your connection. |
queryParamsrequired | object | Query Parameters |
body_typeoptional | one of "none" | "json" | "form_data" | "raw" | Body Type |
bodyoptional | object (depends on other props) | Body |
response_is_binaryoptional | boolean | Enable for files like PDFs, images, etc. |
failsafeoptional | boolean | No Error on Failure |
timeoutoptional | number | Timeout (in seconds) |
followRedirectsoptional | boolean | Follow redirects |
delete_opportunity
Delete Opportunity. Deletes an opportunity.
| Input | Type | Description |
|---|---|---|
opportunity_idrequired | id (picked from your account) | Opportunity |
delete_record
Delete Record. Deletes an existing record in an object.
| Input | Type | Description |
|---|---|---|
objectrequired | id (picked from your account) | Select the Object |
record_idrequired | id (picked from your account) | The record to select. The list shows the 20 most recently created records. |
export_report
Export Report. Export a Salesforce report as an Excel file.
| Input | Type | Description |
|---|---|---|
report_idrequired | id (picked from your account) | Report |
find_child_records
Find Child Records. Finds child records related to a parent record.
| Input | Type | Description |
|---|---|---|
parent_objectrequired | id (picked from your account) | Select the Object |
parent_idrequired | id (picked from your account) | The parent record to find child records for. The list shows the 20 most recently created records. |
child_relationshiprequired | id (picked from your account) | The child relationship to retrieve records from. |
find_record
Find Record. Finds a record by a field value.
| Input | Type | Description |
|---|---|---|
objectrequired | id (picked from your account) | Select the Object |
fieldrequired | id (picked from your account) | Select the Field |
search_valuerequired | text | The value to search for in the selected field. |
find_records_by_query
Find Records by Query (Advanced). Finds records in an object using a SOQL WHERE clause.
| Input | Type | Description |
|---|---|---|
objectrequired | id (picked from your account) | Select the Object |
where_clauserequired | text | Enter the WHERE clause for your SOQL query. For example: `Name = 'Acme' AND Industry = 'Technology'`. Do not include the 'WHERE' keyword. |
get_record_attachments
Get Record Attachments. Get all attachments (both classic and modern Files) for a record.
| Input | Type | Description |
|---|---|---|
objectrequired | id (picked from your account) | Select the Object |
record_idrequired | id (picked from your account) | The record to select. The list shows the 20 most recently created records. |
run_report
Run Report. Execute a Salesforce analytics report and return the results as easy-to-use rows.
| Input | Type | Description |
|---|---|---|
report_idrequired | id (picked from your account) | Report |
filtersoptional | JSON | Apply dynamic filters to the report run. Leave empty to use the report's saved filters. |
send_email
Send Email. Sends an email to a Contact or Lead by creating an EmailMessage record.
| Input | Type | Description |
|---|---|---|
recipientIdrequired | id (picked from your account) | Recipient |
subjectrequired | text | Subject |
bodyrequired | long text | The content of the email. Can be plain text or HTML. |
relatedToIdoptional | text | The ID of a record to relate the email to (e.g., an Account, Opportunity, or Case ID). |
update_contact
Update Contact. Update an existing contact.
| Input | Type | Description |
|---|---|---|
contact_idrequired | id (picked from your account) | Contact |
FirstNameoptional | text | First Name |
LastNameoptional | text | Last Name |
AccountIdoptional | id (picked from your account) | Account |
Emailoptional | text | |
Phoneoptional | text | Phone |
Titleoptional | text | Title |
other_fieldsoptional | JSON | Enter any additional fields to update as a JSON object. |
update_lead
Update Lead. Update an existing lead.
| Input | Type | Description |
|---|---|---|
lead_idrequired | id (picked from your account) | Lead |
FirstNameoptional | text | First Name |
LastNameoptional | text | Last Name |
Companyoptional | text | Company |
Emailoptional | text | |
Phoneoptional | text | Phone |
LeadSourceoptional | id (picked from your account) | Lead Source |
other_fieldsoptional | JSON | Enter any additional fields to update as a JSON object. |
upsert_by_external_id
Batch Upsert (Advanced). Batch upsert a record by external id
| Input | Type | Description |
|---|---|---|
objectrequired | id (picked from your account) | Select the Object |
external_fieldrequired | text | Select the External Field |
recordsrequired | JSON | Select the Records |
upsert_by_external_id_bulk
Bulk Upsert (Advanced). Bulk upsert a record by external id
| Input | Type | Description |
|---|---|---|
objectrequired | id (picked from your account) | Select the Object |
external_fieldrequired | text | Select the External Field |
recordsrequired | long text | Select the Records (CSV format) |
Details
- Id
salesforce- Category
- CRM and sales
- Tags
- crm, sales, enterprise, leads, opportunities
- Package
@activepieces/piece-salesforce@0.7.0- Tier
- Built in