π Real-World Example: Automated Order Approval System
Here's a real-world example of an Automated Cloud Flow with conditions in Power Automate, designed to streamline a common business process:
π¦ Scenario: Automated Order Approval System
- Problem: A company receives orders via a SharePoint list. Orders over $1,000 require manager approval, while smaller orders can be auto-approved and processed immediately.
πͺ Step-by-Step Flow
1️⃣ Trigger
* "When an item is created or modified" (SharePoint connector).
* ⚙️ **Configure:**
* π Site Address: Your SharePoint site.
* π List Name: Orders.
2️⃣ Initialize Variable (Optional)
* Store the order amount for later use:
* π·️ Name: OrderAmount
* π’ Type: Integer
* π° Value: `item()?['OrderAmount']`
3️⃣ Condition
* π€ Check if the order exceeds $1,000:
```
@greater(item()?['OrderAmount'], 1000)
```
* ⬅️ Left Value: OrderAmount (dynamic content).
* ➡️ Right Value: 1000.
* **Branch 1: "Yes" (Requires Approval)**
4️⃣ Request Approval
* π¬ Action: "Start and wait for an approval" (Approvals connector).
* ⚙️ Configure:
* ✅ Approval Type: Approve/Reject.
* π·️ Title: Approve order #@{item()?['ID']}.
* π€ Assigned To: Manager’s email (e.g., `manager@company.com`).
* π Details:
```
Customer: @{item()?['CustomerName']}
Amount: $@{item()?['OrderAmount']}
```
5️⃣ Update Order Status Based on Response
* π€ Condition: If approval is "Approve":
```
@equals(outputs('Start_and_wait_for_an_approval')?['Outcome'], 'Approve')
```
* ✅ Yes:
* Update SharePoint item: Set Status to Approved.
* π§ Send email: Notify the sales team.
* ❌ No:
* Update SharePoint item: Set Status to Rejected.
* π§ Send email: Inform the customer of rejection.
* **Branch 2: "No" (Auto-Approved)**
6️⃣ Auto-Process Order
* Update SharePoint item: Set Status to Approved.
* π§ Send email confirmation to the customer:
```
Subject: Your order is confirmed!
Body: We’re processing your order of $@{item()?['OrderAmount']}.
```
π Real-Time Impact
- π° High-Value Orders:
- Manager receives approval requests instantly via email or Teams.
- Orders are processed only after approval.
- πΈ Low-Value Orders:
- Auto-approved and confirmed to the customer within seconds.
π§© Key Components Used
- π Triggers: SharePoint item creation/modification.
- π€ Conditions:
greater()to check order amounts,equals()to validate approval responses. - π¬ Actions: Approval requests, SharePoint updates, email notifications.
- π¦ Dynamic Content:
item()?['OrderAmount'],item()?['CustomerName'].
✨ Benefits
- ⏱️ Reduced Delays: Low-value orders skip manual approval.
- ✅ Compliance: Ensures high-value orders are reviewed.
- π’ Transparency: Customers receive instant updates.
⭐ Advanced Use Case
- Add a second condition to flag orders from VIP customers (e.g., tagged in SharePoint) for expedited shipping:
@and(less(item()?['OrderAmount'], 1000), equals(item()?['CustomerType'], 'VIP'))- ✅ Yes: Trigger a "Priority Shipping" email.
This flow demonstrates how conditions add intelligent decision-making to automation. Let me know if you’d like to explore other scenarios (e.g., inventory alerts, ticket routing)! π
No comments:
Post a Comment
Note: only a member of this blog may post a comment.