Skip to content
This documentation is currently in preview, therefore subject to change.

Integrate with Microsoft Teams

Build a Doc integrates seamlessly with Microsoft Teams through Power Automate, enabling document generation triggered by Teams messages and notifications posted back to channels.


Teams Triggers

Use Teams as a trigger source for document generation workflows:

Trigger TypeUse Case
Channel message receivedKeyword-based document requests
Adaptive card submissionForm-based document requests
Scheduled messageRecurring document generation

Creating a Message Trigger

To trigger document generation from Teams channel messages:

  1. Create an Instant cloud flow in Power Automate
  2. Select When a new channel message is added as the trigger
  3. Configure your team and channel
  4. Add a Condition to detect a trigger phrase or keyword

Posting Notifications to Teams

Share document generation results with your team:

  1. Add Teams: Post message in a chat or channel action
  2. Include:
    • Confirmation message
    • Link to the generated document (from SharePoint)
    • Relevant metadata (date, document type)
  3. Optionally attach the document directly

Notification Message Format

Your invoice has been generated and saved to SharePoint.
Document: @{outputs('Create_file')?['body/DisplayName']}
Link: @{outputs('Create_file')?['body/Path']}
Generated: @{utcNow()}

Adaptive Cards for Rich Notifications

Use Adaptive Cards for interactive Teams notifications:

  1. Add Teams: Post adaptive card in a chat or channel
  2. Design your card with:
    • Document summary
    • Key metadata
    • Action buttons (View, Download, Approve)

Example: Teams-Triggered Document Generation

Trigger: When a channel message is added
├── Condition: Check for trigger phrase (e.g., "Generate Invoice")
├── Get template from SharePoint
├── Get data source from SharePoint
├── Build a Doc: Convert Word Document
│ - Data: Retrieved from SharePoint
│ - Output: PDF
├── Create file in SharePoint
└── Post notification to Teams channel
└── Include document link and summary

Best Practices

Trigger Phrase Management

  • Use clear, consistent trigger phrases
  • Document trigger keywords for users
  • Consider case-insensitive matching

Message Formatting

  • Keep notifications concise
  • Always include shareable document links
  • Add timestamps for tracking
  • Use adaptive cards for complex notifications

Channel Permissions

  • Verify the Flow Bot has posting permissions
  • Use public channels for broader access
  • Consider hybrid approaches (email + Teams) for sensitive documents

Troubleshooting

Teams Message Won’t Post

  • Verify the channel is public (private channels require explicit Flow Bot access)
  • Confirm Teams connector has channel posting permissions
  • Add the Flow Bot to private channels manually if needed

Trigger Phrase Not Detected

  • Check condition logic for exact text matching
  • Use debugging (Compose actions) to inspect message content
  • Consider whitespace and special characters

Adaptive Card Not Rendering

  • Validate JSON structure in the adaptive card payload
  • Test card in Teams App Studio before deploying
  • Check for unsupported field types or formatting