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 🙏

© 2026 – Pkg Stats / Ryan Hefner

sf-bulk-upsert

v1.0.2

Published

Salesforce Bulk Upsert Tool with Web UI

Readme

Salesforce Bulk Upsert Tool

A modern web-based tool for performing bulk upsert operations on Salesforce objects using CSV files.

Features

  • 🎯 Smart Object Search - Search and select any Salesforce object
  • 📤 Drag & Drop CSV Upload - Easy file uploading with drag-and-drop support
  • 🔑 External ID Field Selection - Choose from recommended external ID fields or any matching field
  • Bulk Upsert Operations - Insert new records and update existing ones in a single operation
  • 📊 Real-time Progress Tracking - Monitor job status with automatic polling
  • 📈 Detailed Results - View success and failure records with full details

Screenshots

  • sf-bulk-upsert-1
  • sf-bulk-upsert-2
  • sf-bulk-upsert-3

Prerequisites

  • Node.js 14.0.0 or higher
  • Salesforce CLI (sf) installed and configured
  • Authenticated Salesforce org

Installation

npm install -g sf-bulk-upsert 

Usage

Start the tool by providing your Salesforce org username or alias:

sf-bulk-upsert start --org [email protected]

Or using an alias:

sf-bulk-upsert start --org MyOrgAlias

Options

  • -o, --org <username> - Required. Salesforce org username or alias
  • -p, --port <number> - Port number for web server (default: 3000)

Example

sf-bulk-upsert start --org mydevorg --port 8080

How to Use

  1. Select Salesforce Object

    • Enter the API name of the object (e.g., Account, Contact, Custom__c)
    • Click "Search" to load the object
  2. Upload CSV File

    • Drag and drop your CSV file or click to browse
    • The tool will analyze the file and show record count and field names
  3. Select External ID Field

    • Choose which field to use for matching existing records
    • Fields marked as External ID in Salesforce are recommended
    • You can also use any field that exists in both your CSV and the object
  4. Execute Upsert

    • Set the wait time (how long to wait for the operation to complete)
    • Click "Start Bulk Upsert"
    • Monitor the progress in real-time
  5. View Results

    • See summary of successful and failed records
    • Click "View Detailed Results" for complete information
    • Export results if needed

CSV File Requirements

  • Must be a valid CSV file with headers
  • Headers should match Salesforce field API names
  • The External ID field must be present in the CSV
  • Maximum file size: 50MB

Example CSV Format

Email,FirstName,LastName,Company
[email protected],John,Doe,Acme Corp
[email protected],Jane,Smith,Tech Inc

Fruits data

Name,External_Id__c
Apple,90daea0d-5ef3-47ea-96b9-b6979bca0308
Banana,f6185906-badd-4a9b-b4c0-46a38f32fe42
Orange,48531516-7861-4021-9fd5-916459f1aec2
Mango,cf1ef998-bd76-4616-a047-5fd53975d9ad
Strawberry,073eab17-b7c4-4c06-be40-3ee6c4ae5797
Grape,98d74a52-8aae-4891-a6ce-fadd84974e37
Pineapple,31cb0edc-8ef3-4bc4-90ab-648c8ad44eee
Kiwi,76a594a8-b64d-49b8-b9e5-848adde80d33
Peach,397f2fba-b2fd-4d05-9faa-98eb75f7aab7
Watermelon,7d6b1e36-dfa6-41d2-893e-7e5c6637005e

How Upsert Works

  • External ID Field: The field used to match existing records
  • Update: If a record with the same External ID exists, it will be updated
  • Insert: If no matching record is found, a new record will be created

Common External ID Fields

  • Account: AccountNumber, External_ID__c
  • Contact: Email, External_ID__c
  • Custom Objects: Any field marked as "External ID" in field settings

Underlying Salesforce CLI Command

The tool uses this command:

sf data upsert bulk --sobject <Object> --file <file.csv> --external-id <Field> --wait <minutes> --target-org <username>

Troubleshooting

"Object not found"

  • Verify the object API name is correct
  • Ensure you have read access to the object

"Field not found"

  • Check that CSV headers match Salesforce field API names exactly
  • Field names are case-sensitive

"Timeout error"

  • Increase the wait time for large operations
  • Check your network connection

"External ID field not found"

  • Ensure the field exists in both the CSV and the Salesforce object
  • For custom External ID fields, verify they're marked as "External ID" in Salesforce

How to kill a server running on a port

#!/usr/bin/env bash

set -euo pipefail

PORT=${1:-}

if [[ -z "$PORT" ]]; then
  echo "❌ Usage: $0 <port>"
  exit 1
fi

if ! [[ "$PORT" =~ ^[0-9]+$ ]]; then
  echo "❌ Invalid port: $PORT"
  exit 1
fi

echo "🔍 Checking for process on port $PORT..."

PID=$(lsof -ti tcp:"$PORT")

if [[ -z "$PID" ]]; then
  echo "✅ No process is running on port $PORT"
  exit 0
fi

echo "⚠️ Process(es) found on port $PORT: $PID"
echo "🛑 Killing process(es)..."

kill -9 $PID

echo "✅ Port $PORT is now free"

License

MIT (c) Mohan Chinnappan

Author

Mohan Chinnappan

Related Tools