Approval-Gated Salesforce Account Creation
Salesforce action: CreateRecord. Sales rep submits new account request via Forms then manager approval via Approvals connector; on approve, creates Account record in Salesforce and posts confirmation to Teams channel.
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
FlowLibs - Approval-Gated Salesforce Account Creation is a manually triggered cloud flow that enforces a manager approval gate before creating new Account records in Salesforce. When a sales rep submits an account request, the flow routes it to a designated approver. On approval, the Account is created in Salesforce and a confirmation is posted to a Teams channel. On rejection, a rejection notice is posted to Teams with the reviewer's comments.
Use Case
Sales organizations need governance over new Salesforce Account creation to prevent duplicates, ensure data quality, and maintain CRM hygiene. This flow adds a lightweight approval step that integrates directly into the team's existing Teams channel workflow — no custom app or portal required. Reps trigger the flow manually with account details, and the approver gets a native Power Automate approval notification.
Flow Architecture
Manually trigger a flow
Manual triggerSales rep provides: Account Name (required), Industry, Website, Phone, and Requester Email (required).
Init varTeamsGroupId
Initialize variableReads the flowlibs_TeamsGroupId environment variable into a variable (runs in parallel with the other init steps).
Init varTeamsChannelId
Initialize variableReads the flowlibs_TeamsChannelId environment variable into a variable (runs in parallel with the other init steps).
Init varApproverEmail
Initialize variableReads the flowlibs_SalesforceAccountApproverEmail environment variable into a variable (runs in parallel with the other init steps).
Start Account Creation Approval
Start and wait for an approvalSends an Approve/Reject approval (Basic type) to the approver email with the submitted account details in the description.
Check Approval Outcome
If conditionBranches on the approval outcome — Approve creates the Salesforce Account and notifies Teams; Reject posts a rejection notice.
- Create Salesforce Account — Creates an Account record in Salesforce with Name, Industry, Website, and Phone fields via the PostItem operation.
- Post Approval Confirmation to Teams — Posts an HTML message to the Teams channel with account details, approver name, and the new Salesforce record ID.
Approval outcome is not Approve — notify the channel with rejection details.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_TeamsGroupId | String | <configure> | The Microsoft Teams Team (Group) ID for posting notifications. Set to your target Team's group ID. |
| flowlibs_TeamsChannelId | String | <configure> | The Teams Channel ID within the Team for posting notifications. |
| flowlibs_SalesforceAccountApproverEmail | String | manager@contoso.com | Email address of the manager who approves new Salesforce Account creation requests. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Approvals | shared_approvals | StartAndWaitForAnApproval (Basic Approve/Reject approval) |
| Salesforce | shared_salesforce | PostItem (Create Account record) |
| Microsoft Teams | shared_teams | PostMessageToConversation (Post approval/rejection notification to 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.
- Import the solution
- Import the FlowLibsApprovalGatedSFAccountCreation solution into your target Power Platform environment.
- Set environment variable values
- Provide flowlibs_TeamsGroupId (your Teams Team ID), flowlibs_TeamsChannelId (target channel ID), and flowlibs_SalesforceAccountApproverEmail (the approver's email address).
- Authorize connections
- Sign in to the Salesforce, Microsoft Teams, and Approvals connectors when prompted during solution import.
- Turn on the flow
- Change the flow state from Off to On after connections and environment variables are configured.
- Test end-to-end
- Run the flow manually with sample account details and verify the approval arrives, the Salesforce Account is created, and the Teams notification posts.
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.01Approval outcome check
Used in the If condition; compared against the literal 'Approve' to branch into the approved/rejected paths.
EXPR.02Approver name in notification
Pulls the responder's display name from the approval response for inclusion in the Teams message.
EXPR.03Rejection comments
Reviewer's free-text comments from the approval, surfaced on the rejection Teams post.
EXPR.04New Salesforce record ID
ID of the newly created Salesforce Account record, included in the approval confirmation message.
EXPR.05Trigger input access
Pattern for reading manual-trigger inputs; same form works for Industry, Website, Phone, and Requester Email.
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.