Code Monkey home page Code Monkey logo

sf-dataloader-cli's Introduction

Command Line Interface for Salesforce Data Loader

What is it?

A PowerShell module intended to simplify the usage of Scripted Data Loader.

Why would you need it?

The Salesforce Data Loader "as is" offers two ways of using it:

  • Data Loader GUI mode offers only limited options to save configuration settings for repetitive tasks.
  • Data Loader Scripting (a.k.a. "Scripted Data Loader") is quite complex to configure and rather unflexible for ad-hoc changes: It requires to write .xml configuration files with the details of the operation to be executed.

This module is intended to fill the gap: You can run Salesforce Data Loader from of the PowerShell command line (What is PowerShell?) for ad-hoc as well as for repetitive tasks:

  • Provides a set of straightforward commands and easy-to-remember command aliases for all operations like EXTRACT, INSERT, UPDATE, UPSERT and (HARD) DELETE.
  • Easy to choose between SOAP API or Bulk API in either serial or parallel mode. Allows to set the batch size via command line option.
  • Auto-creates mapping files in many scenarios.
  • Encapsulates the handling of Salesforce authentication, e.g.
    • by generating key files and encrypting passwords, i.e. the "username + password + security token" style,
    • optionally by using the authorization information as handled by the Salesforce SFDX CLI.
  • Supports all PowerShell standard features like help pages, tab completion for parameters, approved verb best practices etc.

How does it look like?

A very basic example to copy Leads from one Org to another in 4 simple steps. For more examples and command reference see the Wiki Pages

Step 1: Authorize the Source Org

In this example we use the default org of your SFDX project:

$MySourceOrg = sfauth

Step 2: Authorize the Target Org

In this example for a Sandbox org we will give the username and have the password and security token prompted via console input:

$MyTargetOrg = sfauth [email protected] -ConsoleInput -InstanceUrl https://test.salesforce.com

Step 3: Extract all Lead Records from Source Org

Simple example to extract all Leads to a default target file 'Lead.csv':

sfextract $MySourceOrg Lead "SELECT Id, FirstName, LastName, Company FROM Lead"

Step 4: Insert all Leads to Target Org

Simple example to import those Leads from the default source file 'Lead.csv' to another org. A default Data Loader mapping file (.sdl) ist automatically created on the fly from the column headers in the .csv file:

sfinsert $MyTargetOrg Lead

How to get it?

Prerequisites

Mandatory

Optionally

  • Salesforce CLI if you want to use the authentication methods provided by SFDX.

Download and Install SfDataloaderCli PowerShell Module

  • Download the .zip file of the latest stable version from Releases.
  • Extract the files to a target directory of your choice, e.g. D:\sf-dataloader-cli-0.0.1-beta
  • From the Data Loader .zip file (see prerequisites above), locate the Data Loader .jar file: e.g. in the dataloader_v58.0.2.zip this would be the file dataloader_v58.0.2.jar.
  • Copy this .jar file to the corresponding directory in the PowerShell module directory, e.g. to D:\sf-dataloader-cli-0.0.1-beta\dataloader

Import the SfDataloaderCli module into your PowerShell session

  • Open a PowerShell console window.
  • Run Import-Module D:\sf-dataloader-cli-0.0.1-beta\dataloader\SfDataloaderCli.psd1.

Get Started!

See the Wiki Pages on how to get started.

sf-dataloader-cli's People

Contributors

ubraig avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.