How to Update Lookup Field in SharePoint List in Power Automate?

In this Power Automate tutorial, I have mentioned very keen information and minute details that I have implemented in the Power Automate flow to update lookup column values in a SharePoint list.

I have read about how to update SharePoint lookup field values by Power Automate flow. However, I find many of the tutorials confusing, So I thought to write a detailed tutorial on how to update look up column values in SharePoint list in Power Automate.

Update SharePoint List Lookup Field in Power Automate

Now, I will show you how to update a look-up field value in a SharePoint list using Power Automate.

Recently, when we were working on a SharePoint list, there came a scenario where I had to update a SharePoint list lookup column values using Power Automate.

For that, I have created two SharePoint lists. In that one SharePoint list is a Countries List that has two columns, as shown below figure:

Column NameDatatype
Serial NumberSingle line of text – Title column
CountrySingle line of text
power automate update lookup column

The second SharePoint list is the ‘User Registration’ list, which consists of different data types, as shown in the figure below:

Column NameDatatype
User NameSingle line of text – Title column
AgeNumber column
CountryLook Up column
Location: CityLocation column
Email AddressSingle line of text
power automate update lookup column sharepoint

Now, in the User Registration list, ‘Country‘ is a look-up column that is taken from the countries list. Based on the ‘Location: City’, It should update the look-up value in the country field of the ‘User Registration list’.

Example: If City = NewYork – Update country value as ‘ United States of America’.

Follow the below-mentioned steps to build a Power Automate flow that will trigger automatically.

1. Navigate to https://make.powerautomate.com in the browser -> It will open the Power Automate Home page -> Click on +Create -> Select ‘Automated cloud flow’ -> Provide the ‘Flow name’ and choose the trigger, i.e., When an item is created or modified and Click Create.

  • In the trigger, select Site Address and List Name.
power automate update lookup field in sharepoint list

2. In the next step, add the ‘Condition‘ control to provide the conditions below.

(OR) Location: City is equals to 'NewYork'
         Location: City is equals to 'Chicago'
         Location: City is equals to 'San Francisco'
Power Automate update SharePoint look up column

3. Under the ‘If yes‘ condition, add ‘Update item‘ of SharePoint list flow action set the below details.

  • Site Address: Choose a site name from the drop-down menu.
  • List Name: Select a SharePoint list from the drop-down.
  • Id: Include ID from the dynamic content.
  • Country Id: Select a ‘Country ID or Country Name’ that needs to be updated in this column from the drop-down.
power automate update sharepoint list item lookup column

4. And, under the ‘If no’ condition, add the ‘Send an email(V2)’ flow action to send a successful registration email to the user, as shown below.

To: @{triggerOutputs()?['body/EmailAddress']}
Subject: Registartion by @{outputs('Get_item')?['body/Title']}
Body: <p>Hello @{outputs('Get_item')?['body/Title']},<br>
Hope You are doing well!<br>
You have successfully registered the <strong>'User Registration Form'.<br>
</strong>For editing any details please click the link provided Here: <A HREF="@{outputs('Get_item')?['body/{Link}']}">Registration Link</A>
<br>
<br>
Thanks and Regards<br>
Management Team</p>
power automate sharepoint list lookup column value

6. Now, the flow is ready. We have to save and test the flow. Click on Save and Test the flow Manually.

7. At this point, create or modify an item in the ‘User Registration’ list. If the created or modified item satisfies the condition given above, it will update the look-up column value, i.e.,’ Country’, as represented below.

power automate update sharepoint list item lookup column

8. If the condition is not satisfied, it will notify that user about successful registration, as shown below.

Update Look Up Column Values in SharePoint List in Power Automate

This is how to update a look-up column value of a SharePoint list based on the condition using Power Automate.

How to avoid Infinite loop trigger

Now, I will discuss how to avoid the infinite loop trigger in a Power Automate flow.

Infinite loops occur when a flow is triggered by a SharePoint list update item flow action that updates the same list. As a result, the flow will trigger continuously and create an infinite loop that will update the list item with a single value.

To avoid the infinite loop inside a Power Automate flow, follow the below instructions.

Before creating a flow, I added a choice column named ‘Status‘ in the User Registration list with a default value of ‘Not Confirmed’.

How to update the SharePoint lookup column using a Power Automate

Now, I will use this choice column for giving the trigger condition to avoid the infinite loop.

To add the trigger condition in a trigger, click on three ellipses (…) and select settings.

Power Automate Update SharePoint lookup column

In the settings window, Click on +Add to add trigger conditions and Select Done.

@equals(triggerBody()?['Status']?['Value'],'Not Confirmed')
Power Automate updating of SharePoint look up column

In the ‘Update item’ flow action, I will change the ‘Status’ value to ‘Confirmed‘, and then it will jump out of the next cycle when the flow is triggered.

Power Automate updating of SharePoint look up column values

This is how to avoid endless triggers in a Power Automate flow by using the trigger conditions.

Conclusion

When it comes to updating look-up column values in a SharePoint list, many people are confused about it. I hope this Power Automate flow I shared above works perfectly for updating lookup column values in a SharePoint list. Make sure that you have followed the above steps correctly. Did you get an idea on how to update look up column values in SharePoint List in Power Automate?

You may also like: