If you want your Copilot Studio agent to do more than answer questions, one of the most valuable steps is letting it write back to your business data. Creating records in Dataverse or Dynamics 365 is something staff do constantly. Instead of switching apps or filling in a form manually, you can let your agent collect the information and create the record for them. Let’s walk through how to add the Dataverse tool to your agent and how to configure it. The example will demonstrate how your agent can create a new Contact record.

Dataverse connector is used for interacting with your D365 tables, such as Contacts, Accounts, Leads, Opportunities, Cases, any custom tables and more.

Screenshot of Copilot Studio displaying the 'Create a new Contact record' connector action along with related input fields and a confirmation message for creating a new contact.

Step 1: Add Dataverse tool to your agent

Open your agent in Copilot Studio and select +Add tool on the Overview or Tools area.

Screenshot of the Copilot Studio interface showing the 'Staff Helper' overview section, featuring options for knowledge management, web search, and tools to enhance AI engagement.

Select Dataverse from the Connector category.

Screenshot of the Copilot Studio interface showing the 'Add tool' section with suggestions including 'Connector', 'Microsoft Dataverse Connector', and other available tools.

Pick the action Add a new row to selected environment.

Screenshot of the 'Add tool' interface in Microsoft Dataverse, highlighting the option 'Add a new row to selected...'. Various other tool options are also displayed.

This is the out of the box Dataverse tool. It lets your agent create records without building a Power Automate flow or writing any integration logic. When you add it, it can become available for your agent to call whenever a user asks to create a record.

Create a connection by signing in if required. Then click Add and configure.

Screenshot of the Copilot Studio interface showing the 'Add tool' dialog box with options to add a new row in a Power Platform environment and a highlighted connection email.

We’ll next go through the steps of configuring the tool details, inputs, and what happens upon completion.

Step 2: Configure Dataverse tool- Details

In the Details area of the tool, you can update the Name and Description. It is a good idea to rename the tool so you can easily determine it’s purpose, e.g. “Create a new Contact record”.

Updating the Description will help the agent to determine when to use the tool. You should update this too. For example, “Creates a new row in the Contact Dataverse table when the user wants to create a new contact”.

Screenshot of Copilot Studio interface showing the 'Create a new Contact record' tool details, including name and description fields.

Under Additional Details, select if the agent can call on the tool at any time, or only when specifically called in a topic. For more flexibility, select the first option. With this, the user could simply state a phrase such as “Create a new contact” and the agent can call the tool. This means you do not need to create a separate Create a new contact topic or reference the tool in your agent instructions.

Ask the end user before running will first get the user to confirm via the agent if they wish to proceed with creating the record. This is recommended for an action such as creating Dataverse records. You probably want to avoid creating accidental new records! This can mitigate that. If you select Yes here, enter a message the user will see before proceeding. For example, “This will create a new record in D365. Would you like to proceed with creating a new contact record?”.

Screenshot of a software interface showing the process of creating a new contact record, including fields for user prompts and confirmation messages.

When you configure the tool, you will see a setting called Credentials to use. This controls which identity the agent will use when it performs the action.

If you choose Maker provided credentials, it means the tool will run using the credentials of the person who built the agent. In other words, the maker authenticates the connection once, and every time the agent creates a record, it is done under that maker’s Dataverse permissions.

This option is useful when:

  • You want every user to be able to create a record, even if they do not have Dataverse permissions.
  • You need the agent to run with elevated access that end users do not have.
  • You want predictable behaviour because the same identity is used each time.

The alternative option is User provided credentials, where each user must authenticate with their own identity. In that model, the agent can only create records if the signed in user has permission to do so.

Screenshot of the Copilot Studio interface showing the 'Create a new Contact record' section under 'Staff Helper' with options for user interaction and credential selection.

Step 3: Configure Dataverse tool- Inputs

By default, the Inputs area will allow the user to create a record in any Dataverse environment and table (depending on the user permissions). You can configure this so that the intended Environment and table (Contact) is pre-selected. Without setting these values, the agent will take a guess itself or ask the user to select. For this scenario, it is recommended to pre-set the Environment and Table name. For both, change the option to Custom value. Select your intended Dataverse environment from the dropdown. Then, select the table name, such as Contacts.

Screenshot of the Copilot Studio interface showing the 'Create a new Contact record' form with highlighted fields for 'Environment' and 'Table name'.

After selecting the table, required fields/columns in the table will be listed. For this Contact table, Last Name is the only required field. It is recommended to keep this setting as Dynamically fill with AI, so the user can enter the Last Name of the contact themselves.

Screenshot of the 'Create a new Contact record' interface in Copilot Studio, showing input fields for 'Environment', 'Table name', and 'Last Name', with the 'Last Name' field highlighted in red and set to dynamically fill with AI.

You can optionally click Customize (for the Value) for more options on how the value will be captured. You could change the Display name of the field as well as write your own custom prompt/message the agent will send to the user. Changing the entity selected in Identify as can help with clean data capture. For example, if you’re expecting to capture an email address, change Identify as to Email.

Screenshot of the Copilot Studio interface showing the 'Create a new Contact record' section with fields for Display name, Description, Identify as, Prompt, and Message to display.

What if you want more than just the required fields to be captured? Click +Add input and select more columns from the table.

Screenshot of the Copilot Studio interface, showing the 'Create a new Contact record' section. The Inputs tab is displayed, featuring fields for 'First Name', 'Job Title', and an option to add an email input. The environment settings and additional input options are visible on the left.

Step 4: Configure Dataverse tool- Completion

In the Completion stage, you can optionally specify a message the agent will display once the record is created. Otherwise, Write the response with generative AI will automatically generate a completion message for the user.

Underneath the Advanced tab, you will see a list of all the columns/fields from the record. These are available to use as variables.

Screenshot of the 'Copilot Studio' interface showing the 'Staff Helper' tool section for creating a new contact record. Key areas highlighted include 'Completion', 'After running:' with a text box for input, and 'Advanced' options for outputs.

Perhaps after creating the record you want to display a link to the Dataverse record and some basic details. To do so, set After running to Send specific response (specify below).

Enter a message such as:

The contact has been created {First Name} {Last Name}! View the record here: <app URL>{Contact ID}

Screenshot of the Copilot Studio interface showing the creation of a new contact record, with messages displayed about the successful creation of the contact 'Avery Blake'.

The values between { } can be added via the {x} variable button. It will appear under Custom. Look for the output name and select the option containing the word Output:

  • Output.firstname
  • Output.lastname
  • Output.contactid
Screenshot of Copilot Studio interface showing the process to create a new contact record. It includes sections for completion message display, variable selection, and testing agent responses.

To get your app URL, open a Contact record in your Power App/D365. Copy the URL. The full URL of the record could look something like this:
https://org2dd37bb3.crm6.dynamics.com/main.aspx?appid=98fbb12a-0af3-f011-8407-000d3a7a06da&pagetype=entityrecord&etn=contact&id=005bb18e-09f3-f011-8407-000d3a7a06da

Note the part of the URL that is bolded above and highlighted in the screenshot below. This is the part you want to copy for the app URL. Everything after contact&id= is the unique contact id that will be dynamically filled in via the Output.contactid variable.

Screenshot of a contact management system showing details for a contact named Avery Blake, including fields for first name, last name, job title, and email.

Make sure there is no space in between the app URL and the Contact ID variable in your message.

Screenshot of a web interface displaying a message about the creation of a contact record, including placeholders for the first and last name, and a link to view the record.

Step 5: Save and test

Click Save on the tool and open the Test pane. Test your tool by entering a phrase such as “I want to add a contact”.

Screenshot of the Copilot Studio interface displaying the 'Create a new Contact record' tool, with details about the tool, description, and an interactive agent chat on the right.

Continue testing the tool by answering the agent’s questions. Finally, upon reaching the end, your Dataverse record will be created!

Screenshot of the Copilot Studio interface showing the creation of a new contact record within the Staff Helper tool, including input fields for environment, table name, and last name.

Leave a comment