Category: Microsoft 365

  • Power of Prompts in Microsoft 365 Copilot

    Power of Prompts in Microsoft 365 Copilot

    When working with systems—or even with people—the quality of the input plays a crucial role in determining the output.
     Just like giving vague instructions to someone and expecting perfect results is unrealistic, providing unclear or poorly structured input to a system will lead to inaccurate or subpar outcomes.
     Whether you’re dealing with a human or an AI, the principle is the same: clear, well-formatted input leads to reliable and high-quality output.

    Why Prompts Are Important in Enterprise Automation:

    1. Accurate Prompts = Accurate Result
      • Inconsistent or vague prompts can lead to incorrect data, confused conversations, or automation failures. Precise prompts reduce the risk of errors and increase confidence in the automation system.
    2. Prompts Drive Personalized Experiences
      • Good prompts can help the AI respond in a context-aware and personalized manner. For example, a prompt can instruct the AI to greet the user by name, refer to past interactions, or adjust responses based on user roles.
    3. Consistency Across Departments
      • When teams use standardized prompts (especially in Copilot Studio), they ensure consistent messaging and workflow logic across HR, IT, Finance, and Customer Service.

    How to create prompt library in your Org:

    Microsoft provided a way so you can create, and store prompts related to your org and also share them within teams.

    To create a prompt library in Microsoft Copilot Studio, go to the Power Automate app. Click on “More” in the left-hand navigation pane, and you’ll see an option called “Prompts.”
     From there, you can create and store multiple reusable prompts that can be used across different flows and Copilot agents within your organization. This helps ensure consistency, efficiency, and standardization in how your AI assistants interact.

    Same list of prompts you can also use in Copilot Studio for agents or in Microsoft 365 Copilot.

    How to use prompts for Copilot:

    If you are using Copilot studio you might be thinking that all those prompts you can see by default by Microsoft that is true but you can customize that and add your own. Click on see more button below chat box.

    You will then see the Prompt Gallery, which gives you access to Microsoft’s collection of ready-to-use prompts. You can also create your own custom prompts and share them within your organization, making it easy to maintain consistency and reuse across teams and solutions.

    Once you create prompts, they will be visible everywhere within the organization.

    How do I take a prompt and make it my own?

    The Prompt Gallery is like a toolbox filled with ready-made ideas, you don’t have to start from scratch. Microsoft gives you editable prompts with clear placeholders like [file] or [your title] that act as your starting points. But the real magic? You’re not limited to just filling in the blanks.
     You can reshape the entire prompt, weak the goal, adjust the context, set different expectations, or even change the source to perfectly match your business scenario. It’s flexible by design, so your AI speaks your language, not just Microsoft’s.

    Cooking up a great prompt:

    1. Be Clear About What You Need

    Copilot works best when you give it a clear and specific instruction. Instead of saying “Summarize this,” try “Give me a concise summary of recent news about [Product X].” Treat it like a smart teammate—clarity is key.2. Use the 4 Key Ingredients

    Great prompts include:

    • Goal – What should Copilot do?
    • Context – Background info to guide it
    • Source – File or content to use
    • Expectation – Format or tone you want

    This makes the output more accurate and useful.

    3. Keep the Conversation Going

    Don’t stop at one prompt. Ask follow-ups, request changes in tone, or go deeper into a topic. This helps refine the response just like you would with a human assistant.

    4. Smart Prompting Tips

    • Provide enough context
    • Use clear grammar and punctuation
    • Put quotes around exact text
    • Type “new topic” when changing tasks

    These habits lead to better and faster results.

    Conclusion

    Prompts are the key to getting the best results from Microsoft Copilot Studio. Clear, goal-driven instructions help the AI deliver accurate, useful responses. Using tools like the Prompt Library and Prompt Gallery, teams can create, reuse, and share effective prompts. With the right input, Copilot becomes a powerful assistant—boosting productivity and consistency across your organization

  • Automating Purchase Document Approvals in Dynamics 365 with Power Automate

    Automating Purchase Document Approvals in Dynamics 365 with Power Automate

    Manual approval processes are tedious, error-prone, and slow down procurement. Thankfully, Power Automate offers an elegant, fully automated solution that integrates seamlessly with Dynamics 365. In this blog, I’ll walk you through a complete approval automation flow for purchase documents using a real-world scenario.

    Let’s break it down.

    Flow Overview

    Automation kicks off when a purchase document approval is requested in Dynamics 365. From there, we:

    1. Fetch details about the request.
    2. Collect necessary metadata (like the approval link and user info).
    3. Trigger an approval request.
    4. Track the outcome and send email notifications accordingly.

    Here’s what the full flow looks like in Power Automate:

    Step 1: Trigger – When a purchase document approval is requested (V3)

    This is the starting point. The trigger activates whenever an approval is initiated in Dynamics 365 Business Central. It listens for approval requests of purchase documents (like purchase orders).

    Step 2: Get Record from Business Central

    Immediately after triggering, we fetch the full record details using the Get record action. This ensures we have all necessary data (e.g., vendor name, amount, due date) to display in the approval summary and emails.

    • Connector: Dynamics 365 Business Central
    • Purpose: Retrieves a specific purchase document record using the Row ID passed from the trigger
    • Environment:
      • Dynamic input from the trigger using  ‘triggerOutputs()?[‘body/Environment Name’]’
    • Company:
      • Dynamic input using ‘triggerOutputs()?[‘body/Company Id’]’
    • API Category:
      • Set to ‘workflowEndpoints’
      • This points to custom or published API endpoint category in Business Central
    • Table Name:
      • Set to ‘workflowPurchaseDocuments’
      • Represents the API table containing the purchase documents eligible for approval
    • Row ID:
      • Dynamic ID input using ‘triggerOutputs()?[‘body/Row Id’]’
      • Identifies the exact document to retrieve from the specified table

    Step 3: Generate Business Central URL

    The Get URL action constructs a direct link to the record inside Business Central. This is essential for enabling approvers to quickly access and validate the request before acting.

    • Connector:
       Dynamics 365 Business Central
    • Purpose:
       To generate a URL that opens the purchase order directly in Business Central
    • Environment:
       Dynamic value taken from the trigger
       Expression used: triggerOutputs()?[‘body’][‘Environment Name’]
       Ensures the URL corresponds to the correct environment (sandbox or production)
    • Company:
       Dynamic value from the trigger
       Expression used: triggerOutputs()?[‘body’][‘Company Id’]
       Ensures the link opens under the correct company, such as “CRONUS IN”
    • Page:
       Static value set to 50
       Page 50 generally refers to the Purchase Order List page in Business Central
    • Row ID:
       Dynamic value from the trigger
       Expression used: triggerOutputs()?[‘body’][‘Row Id’]
       This uniquely identifies the purchase document for which the URL is being generated

    Step 4: Fetch User Details (Microsoft 365)

    Using the Get user details action from Microsoft 365, we retrieve the approver’s name, email address, and other attributes. This step supports dynamic routing and personalized notifications.

    • Connector:
       Office 365 Users
    • Purpose:
       To retrieve details of the requester such as display name, job title, department, and more
    • User (UPN):
       The value is dynamically provided using:
       triggerOutputs()?[‘body’][‘Requested By User Email’]
    • Where the UPN comes from:
       The email address of the requester is passed from the Business Central workflow trigger

    Step 5: Start and Wait for an Approval

    Now comes the key step — initiating the Start and wait for an approval action. This is a built-in approval connector in Power Automate. We configure:

    • Approval type: Typically “Approve/Reject – First to respond”.
    • Title & Details: Populated using record fields.
    • Link to document: Embedded from the Business Central URL.

    Once triggered, this pauses the flow until the approver responds.

    • Approval type:
       Approve/Reject – Everyone must approve
       This ensures that all listed approvers must approve before it moves forward.
    • Title:
       Static text: Purchase order approval request (Dynamics 365 Business Central)
       Appears in the approval notification email and the Approvals app in Teams/Outlook.
    • Assigned to:
       Static email: sandeep@yourdomain.com
       The approval request will be sent to this user (or list of users).
    • Details:
       This section creates a dynamic message with data pulled from previous steps to provide full context.
       Format used:
       An approval requested by Display Name for Purchase Order {number} totaling {amountIncludingVat} for {buyFromVendorName} must be approved.

    Breakdown of dynamic fields:

    • Display Name → From the “Get user details” step
    • number → body(‘Get_record’)?[‘number’]
    • amountIncludingVat → body(‘Get_record’)?[‘amountIncludingVat’]
    • buyFromVendorName → body(‘Get_record’)?[‘buyFromVendorName’]
    • Item link:
       Uses Web Client URL
       This is generated in the “Get URL” step to provide a direct link to the PO in Business Central.
    • Item link description:
       Uses the purchase order number dynamically:
       Purchase Order {number} → body(‘Get_record’)?[‘number’]
    • Requestor:
       Dynamic expression:
       triggerOutputs()?[‘body’][‘Requested By User Email’]
       Identifies who originally submitted the purchase request.
    • Enable notifications:
       Set to Yes
       Sends email notifications to assigned users for the approval request.

    Step 6: Prepare Approval Summary

    After the approval, we Initialize a response summary variable to collect response details. Then we loop through each response (if multiple) using an Apply to each action and format it — e.g., approver name, comment, and decision timestamp.

    Finally, we finalize the summary by appending the formatted responses into a single string, making it suitable for email or audit logs.

    Step 7: Conditional Logic – React Based on Outcome

    Here’s where it gets smart.

    We use a Switch Control (or condition tree) to react based on the outcome:

    • Approve Path:
      • Executes an “Approve action” in Business Central.
      • If Send Email flag is true, send an Approval Confirmation Email.
      • If not, terminate with a success note.
    • Reject Path:
      • Executes the “Reject action”.
      • Sends a Rejection Email if enabled.
    • Cancel Path:
      • Triggers the “Cancel action”.
      • Optionally sends a Cancellation Notification.

    Each branch uses conditional checks (e.g., “Should it send an email when approved?”) before executing further steps, providing flexibility and avoiding unnecessary noise.

    Email Notifications

    Each branch includes dynamic, well-formatted email templates that:

    • Mention the approver’s decision and comments
    • Link back to the purchase document
    • Include the approval summary
    • Are sent only if enabled by a flag

    Key Benefits of This Flow

    1. No manual follow-ups – Everything runs on its own.
    2. Real-time visibility – Approvers get notified instantly.
    3. Audit-ready – Each approval decision is tracked and stored.
    4. Dynamic and scalable – Easily extend for multi-level or conditional approvals.

    Conclusion

    Automating document approvals in Dynamics 365 using Power Automate is not just about speed, it’s about transparency, accountability, and scale. The flow we walked through today not only streamlines decision-making but also ensures your finance and procurement teams are aligned in real time.

    If you’re using Business Central and haven’t implemented this yet, you’re missing out on serious efficiency.

    Have questions or need help customizing your flow? Drop them in the comments or contact us at STW Services LLP. We’re here to help your business automate the smart way.