web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Facing issue in custom...
Copilot Studio
Suggested Answer

Facing issue in custom prompt document output

(0) ShareShare
ReportReport
Posted on by
I created a custom prompt (Run a prompt) in copilot studio and changed the output format to document, when i upload the document it identifies which fields to replace correctly and works for first time when i test it but when i try to save it doesn't save, and when i test later it throws error, i have seen many are facing this issue, is there any fix yet ? please let me know if you are also facing the same issue and got a solution for this.
Screenshot 2026-04-13 155433.png
I have the same question (0)
  • Suggested answer
    Beyond The Platforms Profile Picture
    155 on at

    Hi there!

    This is a known issue with the Document Output (preview) feature in Copilot Studio's prompt builder. Here are the main causes and fixes based on official Microsoft documentation:

    1. Placeholder format is wrong in the Word template

    All fields to replace must be wrapped in double curly brackets {{ }}. If any field has incorrect formatting, you'll get the placeholder replacement error. For table fields, the format must be {{tablename.columnname}} — and placeholder names cannot contain spaces. Microsoft Learn

    Open your Word template and double-check every placeholder follows this exact syntax.

    2. Template over 5MB — save and reopen before testing

    When you upload a document layout larger than 5MB, you need to save and reopen the prompt before testing. Without this step, the prompt won't work correctly on subsequent tests. Microsoft Learn

    This likely explains the "works first time, breaks later" behavior you're seeing.

    3. Template is not re-uploaded after moving environments

    When moving a prompt from one environment to another using Solutions, the Word template is not moved with the prompt — you need to re-upload it manually in the prompt output settings of the target environment. Microsoft Learn

     4. Workaround if saving still fails — use Power Automate

    Several community members confirmed that when the native prompt save is unreliable, the most stable approach is to use the AI Builder "Run a prompt" action inside a Power Automate flow, passing inputs and capturing the Document Output Content (Bytes) as output. This bypasses the in-studio save issue entirely and is also the recommended production pattern.

    Since this is still a preview feature, it's worth submitting feedback via the 👎 button in the Studio UI or opening a support ticket — Microsoft is actively tracking issues in this area.

    Hope this helps!
    Paolo


    Did this solve your issue? → Accept as Solution
    👍 Partially helpful? → Click "Yes" on "Was this reply helpful?" or drop a Like!


    Want more tips on Power Platform & AI? Follow me here:

    🔗 LinkedIn: https://www.linkedin.com/in/paoloasnaghi/
    ▶️ YouTube: https://www.youtube.com/@BeyondThePlatforms
    📸 Instagram: https://www.instagram.com/beyond_the_platforms/
    🌐 Website: https://www.beyondtheplatforms.com/


     

  • Suggested answer
    AP-26031104-0 Profile Picture
    Microsoft Employee on at

     This is a known intermittent issue that can occur when the document placeholder mapping becomes inconsistent after saving/reopening the prompt. In many cases, the first test run works because the schema is freshly generated, but after save, the internal binding between the prompt output and document template may not persist correctly.

    Suggested workarounds:


    1. Please try recreating the document template (.docx) and re-adding placeholders manually (avoid copy-paste or reused templates).
    2. Ensure placeholders follow a consistent format like {{FieldName}} without extra spaces or styling.
    3. Delete and recreate the “Run a prompt” action instead of editing the existing one.
    4. Test again in a new chat session after republishing.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 645

#2
Vish WR Profile Picture

Vish WR 234

#3
Haque Profile Picture

Haque 211

Last 30 days Overall leaderboard