New Custom Object Detection Alert
Weekly governance flow that pulls all Salesforce object types via GetTables, filters for custom objects (__c suffix), compares against a Dataverse baseline table, and alerts the admin team via Teams when new custom objects are detected. Includes automatic baseline updates for newly found objects.
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
This flow performs weekly Salesforce governance by pulling all current object types from a connected Salesforce org, filtering for custom objects (suffix __c), comparing them against a baseline stored in Dataverse, and alerting the admin team via Microsoft Teams when new custom objects are detected.
The trigger is a weekly Recurrence (every Monday at 8:00 AM US Eastern). The flow ships in Stopped state for demo purposes and should be turned on after configuration.
Use Case
Organizations with Salesforce environments need visibility into custom object proliferation. Unreviewed custom objects can introduce schema bloat, security gaps, and integration fragility. This flow automates the detection of newly created custom objects and notifies a governance team so they can review and approve changes before they become entrenched.
The flow is ideal for teams that:
- IT Admins
- Salesforce Admins
- Governance Teams
Flow Architecture
Weekly_Governance_Check
RecurrenceFires every Monday at 08:00 AM US Eastern to run the weekly Salesforce governance check.
Initialize varTeamsGroupId
Initialize variableString variable hydrated from the `flowlibs_TeamsGroupId` environment variable — Microsoft 365 Group ID for the target Teams team. Runs in parallel with the other five init actions.
Initialize varTeamsChannelId
Initialize variableString variable hydrated from the `flowlibs_TeamsChannelId` environment variable — channel ID within the Teams team for posting alerts.
Initialize varAlertRecipient
Initialize variableString variable hydrated from the `flowlibs_AlertRecipientEmail` environment variable — email address of the governance team lead or distribution list.
Initialize varBaselineEntityName
Initialize variableString variable hydrated from the `flowlibs_SfObjectBaselineEntity` environment variable — logical name of the Dataverse table storing the Salesforce object baseline.
Initialize varNewObjectsHtml
Initialize variableEmpty string variable that accumulates HTML table rows for any new custom objects discovered during the run.
Initialize varNewObjectCount
Initialize variableInteger variable initialized to 0 — counts new custom objects found during this execution.
Get_Salesforce_Object_Types
Salesforce — GetTablesRetrieves all object types from the connected Salesforce org. Runs in parallel with Get_Baseline_Records.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_TeamsGroupId | String | <configure> | Microsoft 365 Group ID for the target Teams team where governance alerts are posted. |
| flowlibs_TeamsChannelId | String | <configure> | Channel ID within the Teams team for posting alerts. |
| flowlibs_AlertRecipientEmail | String | alerts@yourcompany.com | Email address of the governance team lead or distribution list. |
| flowlibs_SfObjectBaselineEntity | String | flowlibs_sfobjectbaseline | Logical name of the Dataverse table storing the Salesforce object baseline (e.g. flowlibs_sfobjectbaseline). |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Salesforce | shared_salesforce | GetTables (retrieves all object types from the connected Salesforce org) |
| Microsoft Dataverse | shared_commondataserviceforapps | ListRecords (reads baseline object records) CreateRecord (appends newly detected objects to the baseline table) |
| Microsoft Teams | shared_teams | PostMessageToChannelV3 (posts governance alerts to a Teams channel) |
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.
- Create the Dataverse baseline table
- Create a custom Dataverse table (e.g. flowlibs_sfobjectbaseline) with at minimum a Name (primary) column. The flow writes new object names here and queries against it each week — without this table the ListRecords and CreateRecord actions will fail.
- Configure the Salesforce connection
- Provide a valid Salesforce OAuth connection with read access to object metadata. The GetTables action requires permission to enumerate the org's object types.
- Point the Teams environment variables at your channel
- Update the flowlibs_TeamsGroupId and flowlibs_TeamsChannelId environment variables to your governance team's M365 Group ID and channel ID.
- Set the alert recipient
- Set flowlibs_AlertRecipientEmail to the governance team's email address or distribution list so the alert metadata reflects the right owner.
- Adjust the recurrence schedule
- The Recurrence trigger ships set to weekly (Monday 08:00 ET). Modify the trigger frequency, interval, or start time if a different cadence is required.
- Turn the flow on after configuration
- The flow ships in Stopped state for safe import. Toggle it On only after all connections and environment variables are configured.
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.01Custom object filter
Used in Filter_Custom_Objects to keep only Salesforce custom objects, which always have an API name ending in `__c`.
EXPR.02New object detection
Used in the Is_New_Object condition — returns true when the Dataverse query found no matching baseline record for the current object.
EXPR.03Environment variable binding
Runtime resolution of a solution-aware environment variable; the same pattern is used for all four flowlibs_* parameters.
EXPR.04Baseline entity dynamic name
The Dataverse ListRecords and CreateRecord actions read the entity logical name from this variable, making the baseline table configurable without editing the flow.
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.