Academy · Module 9

Mission 09: Generate a Candidate Interview Questions Document

Implement document generation from AI prompts

Translated article — This article is based on 🚨 Mission 09: Generate a Candidate Interview Questions Document from the Copilot Studio Agent Academy. The original wording takes precedence.

Document generation walkthrough video thumbnail

🎯 Mission Briefing

Welcome, Operative. In the previous missions, you saw the power of prompts. You learned how to analyze multimodal documents and ground prompts with Dataverse data. Now it is time to unlock another prompt capability: document generation.

This operation is called Operation Doc Assembly. In this task, you will use a prompt to create a Word document with interview preparation questions, then call that document from your agent.

Note — If the screenshots in this lesson look different from your Copilot Studio screens, turn off New Experience in the upper-right corner to switch to the classic experience used here.

🔎 Objectives

In this mission, you will learn how to:

  1. Configure a prompt to output a Word document
  2. Format a Word template for use in a prompt
  3. Run a prompt from an agent

🧪 Lab 9 - Generate an interview document

When a job application is added, you want to automate the process of preparing a detailed interview document. This should be a Word document that summarizes key candidate information such as name, current role, and experience; role information such as job title and requirements; and generates specific, tailored interview questions based on the candidate’s background and the role they applied for.

Prerequisites for completing this mission

  1. Before starting this mission, you need the following:

    • Complete Mission 08, have your agent ready, and understand Dataverse grounding.

9.1 Create the prompt

The first objective is to create a prompt that can analyze a job posting and candidate profile and generate tailored interview questions.

  1. Sign in to Copilot Studio, then select Tools from the left navigation.

    Select Tools
  2. Select the + New tool button.

    New tool button
  3. Select Prompt.

    Select new prompt
  4. Rename the default timestamp name (for example, Custom prompt 09/04/2025, 04:59:11 PM) to Interview Question Document Prep.

    Rename prompt
  5. Add the following prompt to the Instructions field.

     You are tasked with evaluating a candidate’s resume against a specific job listing description and generating a targeted set of interview questions to support structured candidate screening.
     ### Instructions
        
     1. **Extract Candidate Details:**
         - Identify and extract the candidate’s full name.
         - Extract contact information, specifically the email address.
         - Identify the candidate’s current or most recent job title.
         - Extract location if present.
         - Estimate total years of experience only if supported by resume dates.
        
     2. **Analyze the Job Listing Description:**
         - Review the job description to identify:
         - Must-have requirements
         - Nice-to-have requirements
         - Key responsibilities
         - Required tools and technologies
         - Treat must-have requirements as the highest priority for evaluation.
        
     3. **Evaluate Resume Against Job Requirements:**
         - Compare the resume content against each must-have requirement.
         - For each requirement, determine:
             - Evidence level: Strong, Moderate, Weak, or Missing
             - A confidence score from 0–100
             - Supporting evidence using short phrases grounded in the resume text only
         - Do not infer or invent experience.
        
     4. **Assess Overall Candidate Fit:**
         - Identify:
             - Top strengths (up to 5)
             - Key gaps (up to 5)
             - Risks or concerns only when supported by missing or unclear evidence
             - Provide a concise one-paragraph summary suitable for recruiter review.
        
     5. **Generate Interview Questions (Exactly 10):**
         - Generate exactly 10 interview questions based on the job requirements and resume evaluation.
         - Distribute the questions as follows:
             - 5 Core Requirement Questions focused on the most critical must-have requirements.
             - 3 Gap or Clarification Questions targeting weak, missing, or ambiguous areas.
             - 2 Scenario-Based Questions derived directly from key job responsibilities.
         - Avoid generic or culture-only questions unless explicitly required by the job description.
        
     **Interview Question Requirements:**
         - Each question must include:
             - The interview question
             - The job requirement it maps to
          - Questions must be specific, non-duplicative, and grounded in the provided inputs.
          - Produce questions in numbered format (1, 2, 3)
        
     ### Input Data
        
     Application Number:  /ApplicationNumber
     Candidate Details (Name, Email): /CandidateDetails
     Resume Details: /Resume Details
     Job Details (Job Number, Title, Description and Requirements): /JobDetails
     Evaluation Criteria (Weighting, Evaluation Criteria): /Criteria
    
  6. In a new tab, go to make.powerapps.com and find the Job Application table. Note one job application number from that table to use for testing.

    Job Application table
  7. Return to the prompt and scroll down to the prompt’s input data section. Find the /ApplicationNumber text, delete it, and type a slash (/) to open the add input panel. Configure the input as follows.

    Parameter Name Type Sample Data
    ApplicationNumber Text Enter the job application number you copied in the previous step
  8. Now that you have an input for passing the Job Application number, use Dataverse Grounding to retrieve the other related information this prompt needs from Dataverse.

    Tip — If you want to understand Dataverse Grounding more deeply, be sure to complete Module 8.

    In the prompt’s Input Data section, find the remaining slashes and replace them according to the table below to configure Dataverse grounding.

    Parameter Name Table Columns Filter attribute Filter value
    CandidateDetails Dataverse -> Job Application -> Candidate (Candidate) Candidate Name, Email Application Number Add Value -> Application Number
    ResumeDetails Dataverse -> Job Application -> Resume (Resume) Cover Letter, Resume Number, Resume Title, Summary Application Number Add Value -> Application Number
    JobDetails Dataverse -> Job Application -> Job Role (Job Role) Description, Job Role Number, Job Title Application Number Add Value -> Application Number
    Evaluation Criteria Dataverse -> Job Application -> Job Role (Job Role) -> Job Role (Evaluation Criteria) Criteria Name, Description, Weighting Application Number Add Value -> Application Number

    When the input section is complete, it should look similar to the screenshot below.

    Completed prompt inputs
  9. Testing as you go is always a good practice. Select Test to confirm that the prompt shows an initial text output and retrieves the correct information from Dataverse.

    First test
  10. To make this prompt generate a document, you must change the prompt model to one that supports multimodal input and output. Select the model dropdown and change it to GPT-4.1.

    Select model
  11. To have the prompt fill a Word document as output, you need a Word template where the content will be inserted. A template is provided for you. Download the template file here, then open it.

    Note — The template itself is a basic Word document. The key point here is how to add placeholders where the prompt should insert text. Wherever the prompt needs to insert text, add placeholder text for the item you want to fill and wrap it in double curly braces, such as ``, as shown below.

    Word template
  12. So far, you have created a prompt that generates text output. To change it to Word document output, select the Output dropdown in the upper-right corner of the results panel and choose Document (preview).

    Select output format
  13. To connect the template file to the prompt, select the Document settings button, then drag and drop the downloaded file or browse to upload it.

    Document settings
  14. After uploading the file, it should recognize 19 identified fields (identified by finding all curly-brace placeholders). Select the test button again to confirm that the prompt outputs a Word document.

    Document test
  15. You should see a response similar to the following. A link to download the document appears at the top. Select the link and confirm that the document is filled correctly.

    Document output download button
    Example filled document
  16. Click Save to save the new prompt.

    Save prompt

9.2 Create an agent flow that calls the prompt

Now connect the prompt to your agent. To do this, you need to add an agent flow that calls the prompt and returns the file to the agent.

You may wonder why this step is required and why the agent does not call the prompt directly. Currently, it is difficult to reliably retrieve a file’s contentBytes—the actual file content—and return it from the agent as a file item. Using an agent flow lets you extract the file predictably and return it to the agent.

Now create the agent flow.

  1. In Copilot Studio, select the Tools tab.

    Tools tab
  2. Select the New tool button.

    New tool
  3. Select the Agent Flow option.

    Agent Flow button
  4. Click the When an agent calls the flow trigger to expand it, then select the Add an input button.

    Add input
  5. Select Text as the user input type.

    Select input type
  6. Set the input name to ApplicationNumber and enter What’s the job application number as the description.

    Trigger input properties
  7. Select the + plus button below the When an agent calls the flow trigger and add the Run a prompt action.

    Add action
  8. Select the Interview Question Document Prep prompt from the dropdown list.

    Select prompt
  9. Click the ApplicationNumber input field and select the lightning bolt icon.

    Lightning bolt icon
  10. Select the ApplicationNumber input you created earlier.

    Map input
  11. Expand the Respond to the agent action, then select Add an output.

    Add output
  12. Select File from the output type list.

    Select file type
  13. Set the property name to InterviewFile. For the value, click the fx icon, enter the following formula, and select Add.

     binary(outputs('Run_a_prompt')?['body/responsev2/predictionOutput/documentOutput/contentBytes'])
    
    Enter formula

    Note — This formula is required to process the output correctly, extract the file, and return it to the agent.

  14. Select Save Draft to save the flow.

    Save draft
  15. Select the Overview tab.

    Overview tab
  16. Select the Edit button next to Details.

    Edit name
  17. Enter Doc Prep for Flow name and Creates an interview prep document and returns to the agent for description, then click Save.

    Flow name
  18. Select the Designer tab.

    Designer tab
  19. Select the Publish button to publish the flow.

    Publish flow

9.3 Create a topic

Now add a topic to connect all of this to the agent.

The reason you need a topic instead of adding this work to the agent instructions is that, currently, a topic is the only way to guarantee that the file object is returned every time.

Now create the topic.

  1. In Copilot Studio, click the Agents tab, select Interview Agent, and then select the Topics tab.

    Select Topics tab
  2. Select the Add a Topic button and choose From blank.

    Add topic
  3. Rename the Topic name from “Untitled” to Generate Interview Doc.

    Rename topic
  4. In Topic Trigger, enter the following in description.

     This topic generates an interview prep document with applicant details, role details and interview questions.
    
    Topic description
  5. This topic must be able to receive the Job Application Number for generating the interview prep file. To do that, use Copilot Studio’s AI-powered slot filling. This lets the language model’s generative orchestration identify the value that should be brought into the topic.

    To do this, select the Details button in the topic.

    Details button
  6. In the details panel, select the Input tab, then select Create a new variable.

    Create new variable
  7. Change Variable name to VarApplicationNumber. In Description, enter the following.

     Fill with the Job Application Number referenced in the chat. The number always starts with a A followed by at least 5 digits.
    

    Leave all other properties unchanged.

    Completed input variable settings
  8. Select the + plus icon after the trigger, choose Add a Tool, find the Doc Prep flow you created earlier in the list, and select it.

    Select Flow
  9. Click the action’s ApplicationNumber input field, select … three dots, and choose the VarApplicationNumber variable to map it to the input.

    Map variable
  10. Now add a message node to return the file to the user. Click the + plus icon below the action you just added and select Send a message.

    Add message node
  11. Enter Here is your interview prep file: in the text box. Then click the Add button and select the File option.

    Compose message
  12. Click the Content input field, select … three dots, and choose the InterviewFile property.

    Select file
  13. Click the Name input field, select … three dots, and then select the Formula tab.

    Formula tab for name input
  14. Enter the following formula in the formula pane and select Insert.

     Topic.VarApplicationNumber&"InterviewPrep.docx"
    
    Insert name formula
  15. Select Save to save the topic.

    Save topic
  16. Now test whether the new topic works correctly. Open the test panel and enter the following (the example says A01001; replace it with an appropriate job application number from your Job Application table).

     Create an interview prep file for job application A01001
    

    Press Enter.

    Test panel
  17. Confirm that the topic is called, the application number is passed, the flow runs, and the file is returned. Click the document link and confirm that the interview prep document downloads to your local drive.

    Test result
  18. Open the document and confirm that it is filled correctly.

    Check output document

Congratulations! You have successfully added document generation to your agent.

🎉 Mission complete

Well done, Operative! Operation Doc Assembly is now complete. You have successfully enhanced your agent with document generation.

🚀 Next step: In the next mission, you will learn how to use the power of MCP servers to add interview scheduling and planning capabilities.

⏩ Go to Mission 10: MCP integration.

📚 Tactical resources

📖 Document output in prompts

📖 Use your own data in a prompt

📖 Create a custom prompt

📖 Work with Dataverse in Copilot Studio

📖 AI Builder custom prompts overview

📖 Training: Create AI Builder prompts using your own Dataverse data