How to Set a Lookup Field Value in Power Automate with Dataverse Connector
In Power Automate, working with Dataverse often involves updating records with related data. A common scenario is setting a lookup field value, which creates a relationship between two records. In this blog post, we’ll walk through the steps to set a lookup field value in Power Automate using Dataverse.
Sometimes also if you have not used proper format you will get below error.
URL was not parsed due to an ODataUnrecognizedPathException. Resource not found for the segment provided in the URL.
Step-by-Step Guide to solve this and understand correct format to set lookup field in power automate
Step 1: Create a Flow in Power Automate
- Login to Power Automate:
- Start by logging into Power Automate.
- Create a New Flow:
- Click on “Create” and select the type of flow you want to build. For this example, we’ll use an “Automated Cloud Flow” triggered by a new record creation in Dataverse.
- Select a Trigger:
- Search for Dataverse and choose the trigger “When a row is added, modified or deleted”.
- Select the entity (table) that you want to monitor.
Step 2: Add an Action to Update a Record
- Add the ‘Update a Row’ Action:
- After the trigger, click on “New Step”.
- Search for “Dataverse” and select the “Update a row” action.
- Configure the Update Action:
- Choose the entity where you want to update the record.
- In the “Row ID” field, map the unique identifier (GUID) of the record from the previous step.
Step 3: Set the Lookup Field Value
- Identify the Lookup Field:
- Find the lookup field that you want to set. This field represents the relationship between two entities.
- Set the Lookup Field Value:
- The lookup field requires two pieces of information: the Entity Name and the GUID of the related record.In Power Automate, this is done by setting the value as a combination of the entity’s logical name and the related record’s GUID.
Example
<entity_setname>/<GUID>
For the below example, my table logical name is sse_sseproperty but the table set name is sse_sseproperties so here you need to use setname.
ALTERNATE WAY
You can also use below way of setting the lookup value.
<entity_setname>(<GUID>)
How to get Table Set Name.
To copy table setname, you need to open table in Dataverse screen and navigate to Tools -> Copy set name
Hope it helps