Salesforce Schema Discovery & Documentation Generator
On-demand flow retrieves all Salesforce object types, generates a structured documentation page listing each object, its label, API name, and key relationships, and saves it as a reference doc in SharePoint.
Provided as-is, without warranty of any kind. Review and test each pattern in a non-production environment before deploying it to live automations. See our Terms.
Overview
On-demand, manually triggered flow that retrieves every Salesforce object type the connection has access to, formats the result as a styled HTML documentation page, and saves the page to a configurable SharePoint library. Serves as living reference documentation for Salesforce developers, admins, and Power Platform makers who need a quick catalog of available objects and their API names.
Use Case
Salesforce orgs routinely have hundreds of standard and custom objects. Discovering the exact API name for an object (case-sensitive, often differing from the label) is a recurring friction point when writing SOQL, building flows, or integrating with external systems. This flow gives any authorized user a one-click way to regenerate an up-to-date schema reference and publish it to SharePoint for team consumption — no ad-hoc Workbench sessions required.
Run cadence: on-demand. Click Run whenever the Salesforce org has had schema changes (new custom objects, installed packages, sandbox refresh, etc.).
The flow is ideal for teams that:
- Salesforce developers writing SOQL who need accurate, case-sensitive API names
- Salesforce admins maintaining a living schema reference after package installs or sandbox refreshes
- Power Platform makers integrating with Salesforce who need a quick object catalog
- IT teams that want a self-service, one-click way to publish schema docs to SharePoint
Flow Architecture
Manually trigger a flow
Request / Button triggerNo input parameters. Lets any user with flow access regenerate the documentation on demand.
Initialize SharePoint Site URL
Initialize variable (string)Binds the flowlibs_SharePointSiteURL env var to varSharePointSiteUrl.
Initialize Docs Folder Path
Initialize variable (string)Binds the flowlibs_SalesforceDocsFolderPath env var to varDocsFolderPath.
Initialize Timestamp
Initialize variable (string)Computes formatDateTime(utcNow(), 'yyyy-MM-dd-HHmm') into varTimestamp for the output file name.
Get Salesforce Object Types
Salesforce — GetTablesReturns body/value as an array of Salesforce Table objects ({Name, DisplayName, DynamicProperties}). The connector's GetTables operation is Salesforce's 'Get object types' action.
Select Object Rows
Data Operations — SelectFor each table, produces a single-key object {"html": "<tr>...<td>DisplayName</td><td>Name (API)</td>...</tr>"}. Uses the object-wrapped Map-field form so the new designer accepts the value.
Compose Table Rows
Data Operations — ComposeUnwraps the Select output array back into a concatenated HTML row string using nested replace() calls (strips [{"html":", "},{"html":", and "}]).
Compose Documentation HTML
Data Operations — ComposeAssembles the full HTML document: header, generation timestamp, total object count, styled table header, and body rows from Compose Table Rows.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_SharePointSiteURL | String | https://your-tenant.sharepoint.com | Root site URL passed as the dataset parameter to SharePoint CreateFile. Set this to the SharePoint site that hosts the documentation library. |
| flowlibs_SalesforceDocsFolderPath | String | /Shared Documents | Server-relative folder path where the schema HTML file is saved. Change to any existing library or folder (e.g. /Shared Documents/Salesforce Reference). |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Salesforce | shared_salesforce | GetTables (Get object types — primary data source) |
| SharePoint | shared_sharepointonline | CreateFile (Writes the generated HTML documentation file) |
Note — All connections are referenced as solution connection references; the flow is portable between environments as long as a connection is mapped at import time.
Customization Guide
Almost every realistic variant of this flow can be implemented by changing environment variable values. A few cases require small edits inside the flow definition — those are called out explicitly below.
- Change output folder
- Update flowlibs_SalesforceDocsFolderPath to any server-relative library path. Examples: /Shared Documents/Salesforce Reference, /sites/it/Shared Documents, /SchemaDocs. The folder must already exist in the target site.
- Change output site
- Update flowlibs_SharePointSiteURL to a full site URL (e.g. https://contoso.sharepoint.com/sites/crm-docs). Combined with the folder path variable, this controls the complete save location without touching the flow definition.
- Filter to a subset of objects
- Add a Filter Array action after Get Salesforce Object Types that keeps only rows where item()?['Name'] does or does not match a pattern (e.g. keep custom objects only with endsWith(item()?['Name'], '__c')). Then point Select Object Rows at the filtered array instead of body('Get_Salesforce_Object_Types')?['value'].
- Enrich with object metadata
- Add a For each loop over the object list and call Salesforce GetTable (swagger path /$metadata.json/datasets/default/tables/{table}, summary 'Get object metadata') per object to retrieve field-level metadata. Append the detail into the HTML between the row loop and the closing </tbody>.
- Change output format
- Swap the final Compose + SharePoint CreateFile pair for Word Online (GetFilePDF) input, an email via Outlook SendEmailV2 (use varTimestamp in the subject), or a Teams channel post.
- Schedule it
- Replace the manual Request trigger with a Recurrence trigger (e.g. weekly Monday 06:00 UTC) to keep the reference doc continuously fresh.
Key Expressions
The flow is intentionally light on Power Fx / WDL gymnastics — the heaviest expressions are the branch-name concatenation and the approval outcome check. They are listed below in the order they appear in the flow.
EXPR.01Initialize Timestamp
Timestamp slug for the output file name.
EXPR.02Select Object Rows — from
Array of Salesforce Table objects returned by GetTables.
EXPR.03Compose Table Rows
Unwraps the Select object-array output into a single concatenated HTML row string.
EXPR.04Compose Documentation HTML — object count
Total object count rendered into the documentation header.
EXPR.05Save To SharePoint — name
Versioned, timestamped file name — multiple runs produce a history of schema snapshots.
EXPR.06Save To SharePoint — dataset / folderPath / body
Portable output location plus the fully-rendered HTML body.
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.