Translate

Thursday, 10 April 2025

 real-world example of an Automated Cloud Flow with conditions in Power Automate,

 🚀 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.