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 / Need guidance on the a...
Copilot Studio
Answered

Need guidance on the approach I took for a Copilot Studio Agent

(1) ShareShare
ReportReport
Posted on by 143
Hi, 
 
So i have a set of documents in sharepoint which guide users through a set of instructions , I want to train my copilot studio agent. My way of doing it is mentioned below. 
I created topics
Navigator ( for picking the user query )
Creating a custom prompt asking to identify stage and steps and intent as per the user's question and relaying the output in JSON -> navigating to the Helper.   
    Custom Prompt 
    Identify Stage and Steps from the knowledge sources.
    Intent can be of five types.
    Step Guidance → User is asking for instructions or next steps.
    Field Help → User is asking about meaning, purpose, or requirement of a field.
    Error → User is reporting an issue, failure, or unexpected behaviour.
    Navigation → User is asking how to move between pages, sections, or modules.
    Unknown → Intent cannot be clearly determined.
 
Helper ( for creating different prompts for different Intent Types that I later use in 'Create Generative Answer' node ) 
    Here I create different prompts depending on different intent types. Inside these prompts I use Fx to include values of Stage & Steps so that responses will be custom to user's stage. 
    After giving appropriate response using the 'Create Generative Answer' node , I ask the user by providing these options - ['Want to move to the next step', 'Facing an issue', 'Ask another question']
    I use conditional logic to redirect users to
   ------> 'Next Stage Finder' if they want to move to next stage in the Process. 
   ------> Set the Intent to 'Error'  ->'Back to the top of Helper Topic' if the user is facing issue in the given response. 
   ------> 'Navigator' if they have more questions to ask. 
 
Next Stage Finder ( Inputs - Stage , Step , Outputs - Next Stage , Next Step )
   Here I use values from Stage and Step and use a custom prompt in 'Create Generative Answer' node for it to give me the next stage and steps which I send back to the Helper and it starts again from the top. 
 
I have the same question (0)
  • P1999 Profile Picture
    143 on at
    Issue I am facing is that , the 'Create Generative Answers' node sometimes , doesn't give a response. It directly errors. Particularly for those .. where I am asking for JSON output.
  • Suggested answer
    Valantis Profile Picture
    3,490 on at
    Hi @P1999,
     
    The Create Generative Answers node is designed for natural language conversational responses, not structured JSON output. When you ask it to return JSON it errors intermittently because the node validates and moderates responses as conversational text and structured formats like JSON can fail that validation unpredictably.
    For JSON output you need a different approach:
    1. Use a Prompt action (AI Builder custom prompt) instead. Prompt actions are designed for structured output and you can explicitly instruct the model to return JSON. They are more reliable for this use case.
    2. Alternatively use a Power Automate flow with an AI Builder prompt action and return the JSON output back to your topic as a variable.
    The Create Generative Answers node should only be used when you want a natural language answer to be shown to the user, not when you need structured data for processing.
    Ref: https://learn.microsoft.com/en-us/microsoft-copilot-studio/nlu-generative-answers-custom-data
     

     

    Best regards,

    Valantis

     

    ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/

     

  • P1999 Profile Picture
    143 on at
    @Valantis For Intent , custom prompt would work. But for generating stages and steps , I need it to refer knowledge sources. ( in my case SharePoint documents ). 
    For AI Builder custom prompt. 
    The allowed documents is
    Image and document formats accepted: .PNG, .JPG, .JPEG, .PDF. , and not docs. 
    How should I approach with Prompt then ? 
  • Verified answer
    Valantis Profile Picture
    3,490 on at
    Hi @P1999,
     
    Yes correct it does not support .docx as direct input so you cannot pass SharePoint Word documents directly.
    give a go this ones:
    1. In your Copilot Studio topic, call a Power Automate flow and pass the user query as input
    2. In the flow, retrieve and extract the text content from your SharePoint .docx document. There are several ways to do this in Power Automate depending on your setup.
    3. Pass that extracted text as a string input to an AI Builder prompt action configured with JSON output mode
    4. Return the JSON (Stage, Steps, Intent) back to your topic as output variables
     
    This way Power Automate handles the document reading and the AI Builder prompt only receives text, which it handles correctly with JSON output.
     
    For your Helper topic and Next Stage Finder where you are using Create Generative Answers for natural language responses to the user, those are fine to keep as is. The fix only applies to the Custom Prompt step where you need JSON output from document content.
     
     

     

    Best regards,

    Valantis

     

    ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/

     

  • P1999 Profile Picture
    143 on at
    @Valantis Thank you for assisting.
     
    Instead of extracting entire document if I map the stages and steps in a dataverse table. Will it be fine ? 
    For e.g. Process table and Stage Table ( one to many relationship )
    I did a power automate flow where I sent the process and created a JSON of stages and steps and gave that to the Prompt to choose from. 
     
    This works fine in identifying the stage and saves some credits. 
     
    But as I mentioned , I am giving an option to the user to proceed to the next stage. So should I do this again...creating another power automate flow and creating another prompt within it just to get the next stage ?
     
    Or is there a better way to do it ?
  • Suggested answer
    Valantis Profile Picture
    3,490 on at
    Hi @P1999,
     
    Great approach using Dataverse tables, that is cleaner and cheaper.
     
    For the Next Stage Finder you actually do not need another AI prompt at all. Since your stages and steps are already structured in Dataverse, finding the next stage is a simple data query not a reasoning task.
     
    Just add an Order or Sequence column to your Stage table if you do not have one already. Then in a Power Automate flow:

    1. Take the current Stage as input from Copilot Studio
    2. Query Dataverse for the stage with Order = current Order + 1 using List rows with an OData filter
    3. Return the next Stage and its Steps back to your topic as output variables
     
    No AI credits consumed, faster, and deterministic. Save the prompt for the parts that actually need reasoning like identifying intent and stage from the user query. Navigation through a known ordered sequence is just a lookup.
     

     

    Best regards,

    Valantis

     

    ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/

     

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 550

#2
Vish WR Profile Picture

Vish WR 191

#3
Haque Profile Picture

Haque 184

Last 30 days Overall leaderboard