top of page

Prompt Generation and Data Integration in Power Platform Copilot Studio

  • Writer: Tristan Danic
    Tristan Danic
  • Mar 23
  • 3 min read

ree

Introduction


šŸ“ā€ā˜ ļø

Ahoy, matey! Let's set sail on the seas of prompt generation and data integration in Power Platform Copilot Studio. This article be your treasure map, guiding ye through the process of crafting prompts and integrating data directly within 'em, with references to the Model Context Protocol (MCP). So, hoist the Jolly Roger and let's embark on this adventure!

šŸ“ā€ā˜ ļø


Setting Up Your Environment


To maintain proper governance around your Copilot Studio agents and prompts, use a dedicated environment and specific solutions. For this example, we'll use a developer environment (E-SORRVIGG-DEV) and a dedicated solution named sol_Demo.


Accessing Your Prompts


You can access your prompts in two ways:


Via an Agent


  1. Go to Copilot Studio and select your solution.


    ree

  2. Open or create a new agent.

    ree
    ree

  3. Create a new prompt within your topic, integrating it directly within your agent.

    ree

    ree

    ree

Via Tools


  1. Use the "Tools" option to associate your prompt with an agent.

    ree

    ree

    My recommendation is to do it this way as it allows to share it with multiple agents if necessary.


Naming Convention


Naming your prompt is crucial for differentiation. Use the format: prompt_[Project as a quadrigram]_[Description]. For example: prompt_DEPR_ReturnAuthorityJson.

Setting Up Inputs and Outputs


To create an input:

  1. Type ā€œ/ā€ and select a text or image/document (in preview), or click on ā€œAddā€.

    ree

  2. You can also find the ā€œInputā€ option on the right side of your screen.

    ree

  3. Create a Text Input named Query and provide sample data.

    ree


Scenario


We want our prompt to be able to analyse what law has been typed by the user (the Input), check under which regulatory frameworks it falls and to check in our data (in this case a dataverse table) the relevant Authorities linked to it. It has to return a JSON.

To make sure to return a proper formatting, you can specify or give to the prompt an example.


Add your variables directly in the prompt as you type or select them from existing ones.

ree


Prompt Settings


Review your prompt settings:

  • Temperature: Lower temperatures lead to predictable results, while higher temperatures allow more diverse or creative responses.

  • Number of records retrieved: Adjust based on your knowledge sources.

  • Model used: Select the appropriate model for generating responses, considering licensing.

    ree
  • Include links: Decide whether to include links in your response.

    ree

Adding Data

Focus on your Dataverse:

  1. Create a table with your data in the solution.

    ree
  2. Add data to the table.

    ree
  3. Add the action to return data from the table to your prompt.

    ree


ree


ree


ree

Testing and Tweaking

Test the end result and make necessary adjustments. You can filter your knowledge base or include other datasets using inputs and the Knowledge panel.

ree

And then tweaked a bit šŸ˜‰Ā before saving and sharing it in relevant Agents!

ree

Edit and customize your JSON

Go to the Output and select JSON


ree

ree


Make sure to test nad adapt your JSON to your needs.
Make sure to test nad adapt your JSON to your needs.

Implementing in Agent Topics


  1. Add an action and pick your prompt.

    ree
  2. Set the result as a variable and parse it.

    ree
  3. Use ā€œGet schema from sample JSONā€ for the data type and paste your test.

    ree

    ree

    ree


Best Practices and Tips

  • Governance: Ensure that your environment and solutions are well-governed to maintain security and compliance.

  • Documentation: Keep thorough documentation of your prompts and their configurations for future reference and troubleshooting.

  • Collaboration: Work closely with your team to share insights and improve prompt effectiveness.

  • Testing: Regularly test your prompts in different scenarios to ensure they perform as expected.

  • Optimization: Continuously optimize your prompts based on user feedback and performance metrics.


Conclusion

After ye be settin' up, tunin', and adaptin' the JSON, ye can hoist it into yer agent topics. May ye have a grand ol' time creatin' and refin' yer prompts, and may the winds of fortune favor yer sails! šŸ“ā€ā˜ ļø

Comments


bottom of page