Go Back
Upsert Records with the Salesforce Bulk Writer
Publisher
: Lingk Inc.
Run In Lingk
Description
Upserts allow you to Insert or Update new records based off of whether they exist or not via the use of a defined primary key. This recipe shows you how to build a recipe that is able to perform Upserts on a Salesforce instance.
Browse the knowledge base
Twitter
E-Mail
# _____ _ _____ __ # | __ \ (_) |_ _| / _| # | |__) |___ ___ _ _ __ ___ | | _ __ | |_ ___ # | _ // _ \/ __| | '_ \ / _ \ | | | '_ \| _/ _ \ # | | \ \ __/ (__| | |_) | __/ _| |_| | | | || (_) | # |_| \_\___|\___|_| .__/ \___| |_____|_| |_|_| \___/ # | | # |_| # Project Name - UPSERT RECORDS WITH THE SALESFORCE BULK WRITER # Recipe ID - # Recipe URL - https://app.lingk.io/a/10932/tf/17503 # Description - # Upserts allow you to Insert or Update new records based off of whether they exist or not via the use of a defined primary key. # This recipe shows you how to build a recipe that is able to perform Upserts on a Salesforce instance. # Industry - Higher Ed # Business Process - # Systems - Salesforce # Connectors - HTTP, Salesforce # Data Flows - Single Direction # Connection Type - API to API # Data Models ## Salesforce Objects Used: #1. Contact # Add Recipe notes / Change log information here! # _____ _ # / ____| | | # | | ___ _ __ _ __ ___ ___| |_ ___ _ __ ___ # | | / _ \| '_ \| '_ \ / _ \/ __| __/ _ \| '__/ __| # | |___| (_) | | | | | | | __/ (__| || (_) | | \__ \ # \_____\___/|_| |_|_| |_|\___|\___|\__\___/|_| |___/ # # CONNECTORS specify what data will be pulled into the in-memory database during processing connectors: # Configure HTTP & Salesforce credentials in your Environment before running this recipe # HTTP Setup - https://help.lingk.io/en/articles/304-http-connector-setup-guide # Salesforce Setup - https://help.lingk.io/en/articles/267-salesforce-connector-setup-guide ###### Start - HTTP Reader connectors ###### - name: employeeReader type: httpReader properties: url: {{env.vars.sfURL}} # replace url with the personalized one httpMethod: GET ###### End - HTTP Reader connectors ###### ###### Start - Salesforce Writer connectors ###### # Data is being sent to Salesforce via the salesforceBulkWriter Connector # The connector is authenticated within your environment via the connector section # upsert is set to true, and the externalIdFieldName specifices which field the insert/update logic will use - name: sfEmployeeWriter type: salesforceBulkWriter properties: useBearerToken: true # use credentials from the environment sfObject: Contact upsert: true externalIdFieldName: Lingk_External_Id__c # batch: 10 ###### End - Salesforce Writer connectors ###### # _____ _ _ _ # / ____| | | | | | # | (___ | |_ __ _| |_ ___ _ __ ___ ___ _ __ | |_ ___ # \___ \| __/ _` | __/ _ \ '_ ` _ \ / _ \ '_ \| __/ __| # ____) | || (_| | || __/ | | | | | __/ | | | |_\__ \ # |_____/ \__\__,_|\__\___|_| |_| |_|\___|_| |_|\__|___/ # STATEMENTS specify how the data should be processed while in memory statements: - statement: print employeeReader # Create your upsert payload - statement: | (sfDataset) => SELECT Email, EmployeeID Lingk_External_Id__c, upper(FirstName) FirstName, LastName FROM employeeReader # Then 'Upsert' your data with either the insert or update command # UPDATE or INSERT do the same things with upsert: true - statement: INSERT sfDataset INTO sfEmployeeWriter - statement: print sfEmployees # Add more statements to convert, join, aggregrate, transform, and integrate your data
Ellucian Ethos to Salesforce Eda ( Sections / Course Offerings )
On-Premise API Gateway and Salesforce