Skip to content

Salesforce Field Explorer is a Python tool that extracts a list of standard and custom Salesforce objects and exports detailed information about each object's fields into an Excel book. Each object is cataloged in separate sheets within the workbook, providing a comprehensive and navigable overview of an organization's Salesforce schema.

License

Notifications You must be signed in to change notification settings

MSPCode/Salesforce-Field-Extractor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Salesforce Object and Field Exporter

This Python script connects to Salesforce, retrieves a list of Salesforce objects, including standard and custom objects, and exports detailed information about each object's fields into an Excel file. It filters out objects related to change events, history, or shares by default.

Features

  • Connects to Salesforce using provided API credentials.
  • Retrieves field metadata of Salesforce objects based on criteria.
  • Exports field metadata details of objects into an Excel file, with separate sheets for each object.

Prerequisites

Before running this script, you must have:

  • Python 3.x installed.
  • simple_salesforce Python package installed.
  • openpyxl Python package installed.

Installation

  1. Clone or download this repository to your local machine.

  2. Install the required Python packages by running:

    pip install simple_salesforce openpyxl
  3. Create a cred.py file in the same directory as the script with your Salesforce API credentials and preferences:

    # cred.py
    SALESFORCE_USERNAME = 'your_username'
    SALESFORCE_PASSWORD = 'your_password'
    SALESFORCE_SECURITY_TOKEN = 'your_security_token'
    SALESFORCE_SANDBOX = True  # or False

Usage

To run the script, navigate to the directory containing the script and execute:

python extractor.py

The script will connect to Salesforce, retrieve the object list, and for each object, it will fetch and export field details to an Excel file named <org_name>_export_<current_timestamp>.xlsx.

Configuration

Object and Field Selection: By default, the script fetches all objects and their fields. Modify the below section in script if you need to specify certain objects.

object_list = get_all_objects(sf) #use this to extract all objects. **THIS MAY NOT WORK IF YOU HAVE LARGE ORG**
#object_list = ['Account', 'Case', 'Main__c'] #uncomment this if you want to extract specific objects.

Security

Ensure that your cred.py file is securely stored and not included in version control to prevent unauthorized access to your Salesforce credentials.

Contributing

Feel free to fork this repository and submit pull requests to contribute to this project. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

About

Salesforce Field Explorer is a Python tool that extracts a list of standard and custom Salesforce objects and exports detailed information about each object's fields into an Excel book. Each object is cataloged in separate sheets within the workbook, providing a comprehensive and navigable overview of an organization's Salesforce schema.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages