Edit

Share via


Use a flow to add a row in Dataverse

Use the Add a new row action to add a new row in Microsoft Dataverse.

Follow these steps to add a new account in Dataverse when you receive an email to your sign-up address, as shown in the following image:

  1. Create a flow with the When a new email arrives (V3) trigger to your flow.

  2. Select New step to add an action to your flow.

  3. Enter new row into the Search connectors and actions search box on the Choose an operation card.

  4. Select Microsoft Dataverse.

  5. Select Add a new row action.

    Select Add a new row action.

  6. Select the Accounts table in the Add a new row card.

    Select the Accounts table.

    After you select a table, the card expands, displaying both optional and required items. All mandatory items display an asterisk (*).

  7. Optional: If you don't see a column that you need, select Show advanced options at the bottom of the card to view all columns.

    Card that shows all columns for the add a new row action except advanced options.

Tip

You can use outputs from previous triggers and actions in the Dynamic content selector, as shown in the following image, or modify them by building an expression as outlined in Use expressions in flow actions.

Dynamic content.

Set complex fields

Most Dataverse fields contain simple data types where you can set the values intuitively. Two types of fields that are frequently challenging are lookup and multiselect fields.

Set lookup fields

Lookup fields require the following syntax: <entity set name>(<item id>).

For example, if you set the value of the account table primary contact field to a contact record with ID value of aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb, set the lookup by using this value: contacts(aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb).

The tricky part is determining the entity set name. It's usually the same as the plural name of the table, but not always. Use the following procedure to get the correct entity set name for a table by using Power Apps.

  1. Sign in to Power Apps.

    To learn more about using the Power Apps interface, see Get started with Power Apps.

  2. On the left navigation pane, select Tables.

  3. Set the filter to All.

  4. Search for the table you want and select it.

  5. In the Table properties area, expand the Tools menu.

  6. Select the Copy set name command.

    Screenshot of Power Apps contact table with tools expanded and the Copy set name option selected

By using this method, you can always get the correct entity set name.

View all entity set names

Another way to quickly check entity set names is to use your browser to navigate to [Organization URI]/api/data/v9.2/, where [Organization URI] represents the URL for your environment. You can find this Web API endpoint URL in Developer resources in Power Apps. This URL returns a list of all the entity set names. In the results, use Ctrl+F to search for the name you expect to confirm it exists.

{
  "@odata.context": "[Organization URI]/api/data/v9.2/$metadata",
  "value": [
    {
      "name": "aadusers",
      "kind": "EntitySet",
      "url": "aadusers"
    },
    {
      "name": "accountleadscollection",
      "kind": "EntitySet",
      "url": "accountleadscollection"
    },
    {
      "name": "accounts",
      "kind": "EntitySet",
      "url": "accounts"
    },

 [Truncated for brevity]

Learn more about this and other Web API resources

Set multiselect fields

The user interface accepts only one option. To select multiple options, switch the input method to Enter custom value, and then enter a unique name for each option, separating each name with a comma.

Learn more about multiselect 'choices' columns:

Advanced options

Return Full Metadata

This setting controls whether to load all columns from the table or just the essential ones for better performance. If you don't set it, full metadata will still be returned automatically if your flow uses dynamic content or expressions that need it.