Skip to content

Repository files navigation

Salesforce Objects Scanner

Robot Framework Python Salesforce CLI CI License

Salesforce Objects Scanner finds the Salesforce objects available to a user, counts their records where Salesforce allows it, and saves the results as an Excel workbook and JSON files.

It is intended for Salesforce administrators, developers, and migration teams who need a starting inventory for cleanup or migration planning. A Salesforce object is similar to a database table: it stores records such as accounts, contacts, or custom business data. The scanner reads from Salesforce but does not change org data.

Before you start

You need:

  • Git
  • Python 3.10 or later
  • Salesforce CLI, the sf command-line program used to sign in and send requests to Salesforce
  • Access to a Salesforce org through a user who can use the API and read the objects you want to count

See Installation if any of these tools are not ready.

Quick start

Run these commands in a terminal.

1. Download the project and create a virtual environment

git clone https://github.com/b-vamsipunnam/salesforce-objects-scanner-tool.git
cd salesforce-objects-scanner-tool
python -m venv venv

A virtual environment keeps this project's Python packages separate from other projects. Activate it before installing anything.

On Windows PowerShell:

.\venv\Scripts\Activate.ps1

On Windows Command Prompt:

venv\Scripts\activate.bat

On macOS or Linux:

source venv/bin/activate

2. Install the scanner

python -m pip install -r requirements.txt

The command installs Robot Framework, Pabot, and the Excel-writing library in the virtual environment.

3. Sign in to Salesforce

sf org login web --alias MyOrg

A Salesforce org is a Salesforce environment, such as a production org or sandbox. The command opens a browser for sign-in. MyOrg is an org alias: a short local name for that saved login. You can choose another name, but use the same name in the remaining commands.

Confirm that the alias works:

sf org display --target-org MyOrg

The command should show the selected org without an authentication error. Its output contains sensitive connection information, so do not share it.

4. Run the scan

robot -d results --variable ORG_ALIAS:MyOrg src/robot/orchestrator/scan.robot

An object scan asks Salesforce for object names and then runs SELECT COUNT() for each name. The console shows the output workbook path before the count work begins and prints a summary when the run ends.

Results

Each scan creates a directory under output/:

output/Run_<date-time>_<id>/
|-- json/
|-- pabot/
`-- SF_Objects_<date-time>.xlsx

The .xlsx file is the output workbook. Data Objects contains successful counts for standard and custom Salesforce objects. Tooling Objects contains successful counts for development and setup metadata exposed by Salesforce's Tooling API; these objects are included by default. The workbook also contains skipped objects and query durations. The json/ directory holds the same report data for scripts. Robot Framework writes its technical log and report to results/.

A skipped object is an object that Salesforce discovered but the scanner could not count. Always review every row in the workbook's Skipped Objects sheet. A successful Robot Framework run does not mean every discovered object was countable. A missing count is not zero.

Common credential patterns are redacted from captured errors, but the output can still contain sensitive information about your Salesforce org. Store and share the run directory accordingly. See Usage for every output file and Limitations before using the counts in an assessment.

How it works

Salesforce Objects Scanner execution flow

Salesforce CLI discovers objects and runs the SELECT COUNT() queries. Robot Framework controls the workflow and reporting, while Pabot, its parallel runner, runs isolated object batches with test-level splitting. Each generated shard is one Robot test, so PABOT_PROCESSES controls concurrency and PABOT_SHARDS_PER_PROCESS controls the number of queued shards per process. See Architecture for details.

Documentation

Guide What it covers
Installation Prerequisites and local setup
Authentication Salesforce CLI login and permissions
Configuration Robot variables, defaults, and timeouts
Usage Running a scan and reading its output
Architecture Execution flow and component responsibilities
Troubleshooting Common failures and practical fixes
Limitations What the counts do and do not represent

See CONTRIBUTING.md to work on the project. This project uses the MIT License.

About

Parallel Salesforce object inventory and record-count scanner with explicit skipped-object classification, JSON and Excel reporting, and configurable quality checks.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

6 stars

Watchers

4 watching

Forks

Releases

Packages

Contributors

Languages