KTL Blog

Populate Lookup Fields in Dynamics 365 Using Power Automate Flows

Written By Jerome Stewart 

Dynamics 365 and Power Automate are powerful tools that help automate and connect your business processes. One common challenge users face is how to populate lookup fields in Dynamics 365 when using the “Update a Row” step in Power Automate.

In this guide, we’ll walk through how to properly populate lookup fields, avoid common issues, and ensure your automation flows run smoothly.


What Are Lookup Fields in Dynamics 365?

Lookup fields in Dynamics 365 let you link one entity to another—for example, connecting a Contact record to an Account record. These relationships enhance your data model, making reporting and visualization easier.

When working in Power Automate, it’s crucial to populate lookup fields correctly to maintain data integrity. This typically involves referencing the GUID (Globally Unique Identifier) of the related record.


Step-by-Step: How to Populate Lookup Fields in Dynamics 365

Step 1: Identify the Lookup Field

In Dynamics 365, locate the entity and lookup field you want to populate. Note the schema name of that field—you’ll need it when setting up the “Update a Row” action in Power Automate.

Step 2: Retrieve the GUID of the Related Record

Every lookup field requires the GUID of the related record. You can retrieve this by:

  • Using the “List Rows” step in Power Automate, or
  • Manually copying it from the Dynamics 365 record URL.

Step 3: Configure the “Update a Row” Step

  1. In Power Automate, open your flow.
  2. Add or locate the “Update a Row” action.
  3. Select the table (entity) containing the record to update.
  4. Provide the Row ID of the record you want to modify.

Step 4: Populate the Lookup Field

Use this format for your lookup field value:

EntitySetName(GUID)

Example:

accounts(12345678-1234-1234-1234-123456789abc)

Replace accounts with your entity’s plural name and the GUID with your specific record ID.

Step 5: Test and Validate

Run your flow to ensure the lookup field is correctly populated in Dynamics 365. If it doesn’t work as expected, verify the GUID and entity name.


Common Issues and Troubleshooting

Incorrect GUID Format

Ensure the GUID is valid and properly formatted. Copy it directly from Dynamics 365 or via Power Automate queries.

Wrong Entity Name

The EntitySetName is the pluralized name of your table. This might differ for custom tables, so confirm it using tools like the Metadata Browser for XRM Toolbox.

Permissions

Ensure the flow owner has sufficient access to both the source and target entities.

Dynamic Data and Null Values

If you’re dynamically populating lookup fields, null values can cause failures. To prevent this:

  • Use a variable to store the lookup reference.
  • Apply a conditional check to ensure data exists before setting the variable.
  • Set the variable to Null if no data exists.

This helps prevent your flow from failing when the lookup reference is empty.


Tips for Efficiency

  • Use the “List Rows” step to dynamically retrieve GUIDs instead of hardcoding them.
  • Document entity relationships and schema names for easy reference.
  • Test your changes in a sandbox environment before deploying to production.
  • For more workflow tips, check Microsoft’s official documentation on Power Automate and Dataverse connectors.

Conclusion

Learning how to populate lookup fields in Dynamics 365 using Power Automate’s “Update a Row” step is essential for maintaining data accuracy and creating seamless automations. By following these steps, you’ll ensure your flows run efficiently, your records stay connected, and your data remains reliable across your entire Dynamics 365 environment.


Contact KTL today for more information!

Related Articles

Scroll to Top