A Streamlit-based Salesforce toolkit for running SOQL queries, exploring object metadata, and managing records directly from your browser.
This app provides a clean, dark-themed interface for:
- Connecting to a Salesforce org using username, password, and optional security token.
- Running ad hoc
SELECTSOQL queries and viewing results in an interactive table. - Using the new “Ask in Plain English” helper to turn natural-language requests into SOQL queries.
- Downloading query results as CSV.
- Loading Salesforce records for inline editing, insert, update, and delete operations.
- Exploring Salesforce object metadata, field counts, relationships, picklists, and field type distributions.
- Managing custom objects and fields, including new Field-Level Security (FLS) support for assigning profile-based read and edit access.
Found under the Configuration page:
- Choose between
ProductionandSandboxenvironments. - Enter Salesforce username and password.
- Provide a security token when required by your org.
- Test the connection and display success or troubleshooting hints.
Found under the Salesforce SOQL Editor page:
- Write any valid
SELECTSOQL query. - Use the new “Ask in Plain English” feature to describe the data you want in plain language and generate or refine a SOQL query.
- Execute the query and show response data in a sortable Streamlit table.
- Support for relationship fields and child relationship expansion in query results.
- Download query results as a CSV file.
Also on the Salesforce SOQL Editor page:
- Select a Salesforce object and choose fields to display.
- Load records using an optional
WHEREclause. - Edit returned records directly in a spreadsheet-like editor.
- Insert new rows, update modified rows, and delete checked rows.
- Automatically detect real changes to avoid unnecessary updates.
Also on the Salesforce SOQL Editor page:
- Perform bulk record operations in the SOQL editor using Salesforce-compliant batch logic.
- Select multiple records and apply insert, update, or delete actions together.
- Reduce API round trips and improve throughput for large data changes.
- View bulk operation progress and error feedback directly in the app.
Found under the Field Analysis page:
- Analyze any Salesforce object metadata.
- Show total field counts, custom fields, required fields, relationships, and child relations.
- Display field type distributions with Plotly charts.
- Browse detailed field rows with labels, types, lookup relationships, and custom field flags.
- Inspect picklist values for picklist and multipicklist fields.
Found under the Object Manager page:
- Create new custom objects and define custom fields (Text, Number, Picklist, etc.) using the Metadata API.
- Modify or delete existing custom fields on any object.
- Apply Field-Level Security (FLS) when creating or updating fields, including profile-based read and edit permissions.
- Set default FLS behavior for newly created fields to streamline field rollout across profiles.
- Browse all available Salesforce objects in the connected org.
- View object labels, API names, field counts, and record counts at a glance.
- Search and filter objects for faster navigation.
- Expand object details to inspect schema metadata and relationship summaries.
Found under the Session Information page:
- Display the current Salesforce connection status and org details.
- Show the active username, instance URL, and API version in use.
- Provide helpful connection diagnostics for troubleshooting login issues.
- Allow users to verify whether the app is connected to Production or Sandbox.
- Useful for verifying that the app is connected to the correct Salesforce org before performing operations.
The project is organized around a main app entry point, a small set of shared utilities, and a multi-page Streamlit interface:
Home.py- Main Streamlit entry point, homepage layout, and overall app styling.permissions.py- Shared helpers for loading Salesforce profile permissions, applying read-only safeguards, and controlling access to admin-level features.pages/1_⚙️_Configuration.py- Connection setup page for authenticating to Salesforce and selecting the environment.pages/2_📝_Salesforce_SOQL_Editor.py- SOQL editor for running queries, viewing results, and managing records inline.pages/3_📊_Field_Analysis.py- Metadata explorer for analyzing fields, relationships, picklists, and field type distributions.pages/4_📦_Object_Manager.py- Object and field management experience for creating, editing, and configuring custom metadata.pages/5_👤_Session_Info.py- Session diagnostics page showing the active connection details and org information.requirements.txt- Python dependencies required to run the app..gitignore- Lists files and folders that Git should ignore, such as virtual environments, local secrets, and editor-specific artifacts.LICENSE- Contains the open-source license terms for the project.README.md- Provides project overview, setup instructions, usage guidance, and feature documentation.
The app relies on the following packages:
streamlitpandassimple-salesforceplotlyrequestszeepopenai
- Create a Python virtual environment:
python -m venv .venv- Activate the virtual environment:
Windows PowerShell:
.\.venv\Scripts\Activate.ps1- Install dependencies:
pip install -r requirements.txtFrom the repository root, run:
streamlit run app.pyThen open the URL shown in your browser (usually http://localhost:8501).
- Use
Productionfor a live org andSandboxfor developer/test instances. - If your org enforces IP restrictions, include your Salesforce security token.
- If your IP is already trusted, leave the security token blank.
- Common connection issues include invalid credentials, missing security token, and selecting the wrong environment.
- Open the app in your browser.
- Go to the
Configurationpage and connect to Salesforce. - Use the
Salesforce SOQL Editorpage to run queries and manage records. - Use the
Field Analysispage to inspect object metadata and picklist values.
INVALID_LOGINmeans your username or password is incorrect, or the org selection is wrong.security tokenerrors indicate that a token is required by your Salesforce org.Could not connector404errors usually mean the wrong environment was selected (Production vs Sandbox).
- The app is designed for Salesforce admins, analysts, and developers who need quick query and data editing capabilities without switching to Salesforce UI.
- The app uses the Salesforce REST API via
simple-salesforceand requires valid Salesforce credentials.
You can try the hosted version of this app here:
- https://sf-query-studio.streamlit.app/ (opens the deployed Streamlit app)
Note: The deployed demo may not include a working Salesforce connection for security reasons — use your own credentials via the Configuration page when running locally or in a trusted environment.
- Clone the repository:
git clone https://github.com/abuawaish/salesforce_db_app.git
cd salesforce_db_app- Create and activate a Python virtual environment (recommended):
python -m venv .venv
source .venv/bin/activate # macOS / Linux
.\.venv\Scripts\Activate.ps1 # Windows PowerShell- Install requirements and run the app:
pip install -r requirements.txt
streamlit run app.py- This app requires Salesforce credentials (username, password, and optionally a security token). Do not commit credentials to version control.
- Store secrets securely using environment variables, Streamlit secrets, or a secrets manager rather than hard-coding them into source files.
- Use least-privilege access when connecting to Salesforce. The app should only be used with accounts that have the minimum permissions needed for the intended operations.
- Be mindful of data exposure: SOQL results, record edits, and object metadata can contain sensitive business information. Avoid sharing screenshots or exports that include confidential data.
- If your org enforces IP whitelisting, you can leave the security token blank when your IP is already trusted in Salesforce.
- When deploying publicly, ensure your app is protected behind authentication and that any hosted environment is configured to avoid leaking session or credential information.
- Review any generated reports, exports, or copied query results before sharing them externally.
Contributions are welcome. Suggested workflow:
- Fork the repo and create a feature branch.
- Add tests for new functionality where appropriate.
- Open a pull request describing your changes.
If you have questions, run into issues, or want to suggest improvements, please open an issue in the GitHub repository or reach out to the maintainer via GitHub: abuawaish.
Contributions and feedback are always welcome.