npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sf-vlookup

v0.0.9

Published

This cli is to do the vlookup between two files after extracting the data from Salesforce and load the updated file to Salesfoce instance automatically.

Downloads

22

Readme

Salesforce vlookup and data load

This CLI is a useful utility to do the vlookup between two files after extracting the data from Salesforce and load the new updated file to the Salesforce instance automatically (can be by-passed) using Bulk API 2.0 to update the data of the primary object. The result will be stored in the output folder with the salesforce instance-id folder. The output folder will typically contain 7 files which comprise of:

  • Data defined as per the SOQL query:
    • Primary Object file
    • Secondary Object file
  • Comparision files:
    • With matching result
    • Without matching result
  • Data Load files:
    • Failed Result
    • Successful Result
    • Unprocessed Result

Note: the primary object is the one that will be changed/updated using the second object data.

Install

$ npm install sf-vlookup -g

How Do You Use It

  To get help:
    $ sf-vlookup --help
    $ sf-vlookup -h

  Login to already authentacted Salesforce instance:
    $ sf-vlookup -u sf_instance_alias -pq "SELECT Id, Name FROM Account" -sq "SELECT Id, Email, LastName FROM Contact" -fm Name:Name,CustomField_Primary__c:CustomField_Secondary__c -c "CustomField_Primary__c:CustomField_Secondary__c"

  Login to Salesforce production:
    $ sf-vlookup -p -pq "SELECT Id, Name FROM Account" -sq "SELECT Id, Email, LastName FROM Contact" -fm Name:Name,CustomField_Primary__c:CustomField_Secondary__c -c "CustomField_Primary__c:CustomField_Secondary__c"

  Login to Salesforce sandbox instance:
    $ sf-vlookup -pq "SELECT Id, Name FROM Account" -sq "SELECT Id, Email, LastName FROM Contact" -fm Name:Name,CustomField_Primary__c:CustomField_Secondary__c -c "CustomField_Primary__c:CustomField_Secondary__c"

  By-pass DML operation:
    $ sf-vlookup -b -pq "SELECT Id, Name FROM Account" -sq "SELECT Id, Email, LastName FROM Contact" -fm Name:Name,CustomField_Primary__c:CustomField_Secondary__c -c "CustomField_Primary__c:CustomField_Secondary__c"

Options

Options:
  -V, --version                        version number
  -p, --production                     production
  -b, --bypass-dml                     by-pass DML operation
  -u, --user-name                      salesforce instance user name or alias, if already defined, the Salesforce instance
  -pq, --primary-query                 (Required) Query of primary object
  -sq, --secondary-query               (Required) Query of secondary object
  -fm, --comparable-field-map          (Required) Comma-separated list of fields API name of primary to secondary object to compare the data files. This is used to find the records with an exact match. We can add as many comparison attributes as we need from both CSV files. Like:
                                        Name:Name,CustomField_Primary__c:CustomField_Secondary__c
  -c, --copy-field-value                (Required) Field API name to be transformed and updated. Like:
                                        CustomField_Primary__c:CustomField_Secondary__c
  -h, --help                           display help for command

Prerequisite

To use sf-vlookup CLI sfdx should be installed, here is the information to install sfdx

npm install sfdx-cli --global