Go Back
Salesforce Power Reader (a better Workbench)
Publisher
: Lingk
Run In Lingk
Description
his recipe demonstrates how you can use SOQL to query any object in Salesforce, transform the data and write it back to Salesforce or SFTP. To use this recipe, configure an SFTP and Salesforce connector in your environment.
Browse the knowledge base
Twitter
E-Mail
# _____ _ _____ __ # | __ \ (_) |_ _| / _| # | |__) |___ ___ _ _ __ ___ | | _ __ | |_ ___ # | _ // _ \/ __| | '_ \ / _ \ | | | '_ \| _/ _ \ # | | \ \ __/ (__| | |_) | __/ _| |_| | | | || (_) | # |_| \_\___|\___|_| .__/ \___| |_____|_| |_|_| \___/ # | | # |_| # Project Name - SALESFORCE POWER READER (A BETTER WORKBENCH) # Recipe URL - https://app.lingk.io/a/10932/tf/17480 # Description - This recipe demonstrates how you can use SOQL to query any object in Salesforce, transform the data and write it back to Salesforce or SFTP. # To use this recipe, configure an SFTP and Salesforce connector in your environment. # Industry - Higher Ed # Business Process - Graduate Reporting # Systems - Salesforce, SFTP # Connectors - # Data Flows - Single Direction # Connection Type - API to SFTP # Salesforce Objects #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 SFTP & Salesforce credentials in your Environment before running this recipe # SFTP Setup - https://help.lingk.io/en/articles/296-sftp-setup-guide # Salesforce Setup - https://help.lingk.io/en/articles/267-salesforce-connector-setup-guide ###### Start - Salesforce Reader connectors ###### # salesforce reader - replace credentials and SOQL # extend schema for fields that a values may be null in the query # NOTE: the SF password is combination of password + security key (no spaces) - name: reader type: salesforceReader properties: useBearerToken: true isSandbox: false query: SELECT Id FROM Contact schema: fields: - name: Id type: String ###### End - Salesforce Reader connectors ###### ###### Start - Salesforce Writer connectors ###### # salesforce writer - replace credentials and sfObject name - name: sfWriter type: salesforceBulkWriter properties: onError: continue useBearerToken: true isSandbox: false sfObject: Contact # batchSize: 50 # default 10000 # upsert: true # default false - requires external Id in sfObject ###### End - Salesforce Writer connectors ###### ###### Start - SFTP Writer connectors ###### # sftp writer - replace credentials and path #- # name: ftpWriter # type: sftpWriter # format: comma # properties: # path: / # for writing data to FTP or s3 writeFormats: - name: comma type: delimited properties: quoteAllFields: true delimiter: ',' header: true ###### End - SFTP Writer connectors ###### # _____ _ _ _ # / ____| | | | | | # | (___ | |_ __ _| |_ ___ _ __ ___ ___ _ __ | |_ ___ # \___ \| __/ _` | __/ _ \ '_ ` _ \ / _ \ '_ \| __/ __| # ____) | || (_| | || __/ | | | | | __/ | | | |_\__ \ # |_____/ \__\__,_|\__\___|_| |_| |_|\___|_| |_|\__|___/ # STATEMENTS specify how the data should be processed while in memory statements: #******************************************************************** D I S C L A I M E R *********************************************************************************************** # * # Note that in an effort to keep recipes optimized for DPH (Data Processing Hours), print statements should be commented out after development has concluded for a recipe. * # For more information on DPH optimization, please visit the following help article - https://help.lingk.io/en/articles/212-minimizing-data-processing-hours-on-the-lingk-platform * # * #******************************************************************** D I S C L A I M E R *********************************************************************************************** # get data from the reader (you can add, join, aggregrate, and transform data) - statement: (data) => select Id from reader # print data #- statement: print data # operate on data #- statement: (results, errors) => insert data into ftpWriter #- statement: (results, errors) => insert data into sfWriter #- statement: (results, errors) => update data into sfWriter #- statement: (results, errors) => delete data from sfWriter # print row count - statement: (readerCount) => select count(*) from reader #- statement: print readerCount # Add more statements to convert, join, aggregrate, transform, and integrate your data
SFTP to Moodle (Upsert users)
SFTP to Salesforce