Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Outlook
    • Planner
    • Power Apps
    • SharePoint
    • Teams
  • Triggers
  • Ready to use solutions
    • Approval Process Template
    • Task Delegation App
    • The Ultimate Power Automate expressions cheat sheet
    • Power Automate HTTP requests to SharePoint cheat sheet
    • Power Automate HTTP requests to Graph API cheat sheet
  • ABOUT ME
  • Get help with your flow
  • POWER PLATFORM SERVICES
Menu

How to update Dataverse lookup column with Power Automate

Posted on November 16, 2022November 16, 2022 by Tom

“I always get some URL error when trying to update Dataverse lookup column in a Power Automate flow, what does it want from me?”


Lookup columns are the more complicated ones to work with, no matter what datasource you use. Let it be SharePoint or Dataverse, updating lookups can be challenging. In SharePoint you must get the id of the lookup item before you can update it, and in Dataverse it’s similar, yet a bit more complicated.

Additionally to the unique id of the lookup row you’ll need also the lookup table entity name. How do you get it?

Power Automate dataverse lookup update

Get the table entity name and update the column

Firstly, get the url to your organisation environment. Add the ‘List rows’ action followed by a ‘Compose’ and store the ‘value’ output in the ‘Compose’ action. The reason is that the ‘List rows’ action doesn’t show the JSON it returns directly.

Run the flow and check the ‘Compose’ action in the run history. The second row will contain the url to your environment, copy it up to the /9.1/ part.

Enter the url in the browser and press Enter, it’ll show you a list of all the tables.

Go to the table with the lookup values, open its ‘Properties’, and copy its ‘Logical name’.

Search for the logical name in the list of tables.

Power Automate dataverse lookup update

Once found, copy the whole ‘name’ value and use it together with the row id to update the lookup field, e.g.

/cr09b_lookuptables(d663e4e5-d365-ed11-9561-0022489fdc7c)

And that’s it, you just updated the lookup field in Dataverse. Although there’s a small problem – such update will return an error message if there’s no value to update. So let’s continue.

Remove value from a lookup column

If on the other side the column already has a value and you want to remove it, use the null expression. Not a text, an expression!

Combine it together

Now you know how to update a value and how to remove a value from the column, and you can put it together in a single expression. If there’s a value use the value, and if there’s no value use null to avoid errors.

if(empty(<guid>), null, '/<tableName>(<guid>)')

Since the <guid> will be probably a dynamic content, you’ll have to combine it with the concat(…) expression.

if(empty(<guid>), null, concat('/<tableName>(', <guid>, ')'))

In the end it might look as the example below:

if(empty(outputs('Compose_2')), null, concat('/cr09b_lookuptables(', outputs('Compose_2'), ')'))
Power Automate dataverse lookup update

Summary

It might be a challenge to update Dataverse lookup column with Power Automate as it has such a specific format. Additionally to the row id you need also the table logical name in plural – something that’s not visible anywhere in the user interface. But with the right url you can easily find it, and use it for the update.


πŸš€ Master Power Automate

Join 2,000+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

12 thoughts on “How to update Dataverse lookup column with Power Automate”

  1. Oliver says:
    December 19, 2022 at 6:43 am

    Getting a 401 error when trying to go to the URL of the environment.

    Reply
    1. Tom says:
      January 9, 2023 at 3:47 pm

      Hello Oliver,
      I’m not sure what type of permission do you need on the environment, I’d try to contact the environment admin to call the url address to see if it’s a permission issue or if the url is wrong.

      Reply
  2. Jochen says:
    March 24, 2023 at 10:19 am

    my learning regarding “remove value” = in my case listrow action returned not empty but 00000000-0000-0000-0000-000000000000′ for the column so therefore i had to add a second if condition:

    if(or(empty(body(‘Parse_JSON’)?[‘_objectid_value’])
    ,equals(body(‘Parse_JSON’)?[‘_objectid_value’], ‘00000000-0000-0000-0000-000000000000’)
    )
    , null
    , concat(‘/accounts(‘, body(‘Parse_JSON’)?[‘_objectid_value’], ‘)’)
    )

    Reply
  3. Kevin says:
    February 5, 2024 at 5:59 pm

    Sir you are a lifesaver. Thank you so much.

    Reply
  4. Paul Marriott says:
    May 17, 2024 at 4:28 pm

    Great Post Tom, concise and right to the point,

    Many thanks

    Reply
  5. Mike says:
    May 17, 2024 at 4:45 pm

    Thanks for the post. It gives me a start on how to deal with lookups.

    Reply
  6. Taiju says:
    June 4, 2024 at 1:35 pm

    This syntax works for inserting the record to the table, correct? I am struggling to inserting record with lookup column with this syntax and keep receiving the error of below.

    {
    “error”: {
    “code”: “0x80060888”,
    “message”: “Bad Request – Error in query syntax.”
    }
    }

    Syntax used are, there are two lookups, below

    /cr1da_projects(‘********-0218-ef11-840a-002248e87f0e’)
    /cr1da_members(‘********-f102-ef11-9f89-6045db64ab9a’)

    Please help

    Reply
  7. Bob Lamaster says:
    September 25, 2024 at 6:51 pm

    If the logical name of the lookup table is singular, you will need to make it plural when trying to update the lookup column in Power Automate. For example:

    “systemuser(00000000-0000-0000-0000-000000000000)” does not work, even though the table properties say the logical name is “systemuser”.

    Instead, you make it plural:
    “systemusers(00000000-0000-0000-0000-000000000000)”

    Reply
  8. Jim says:
    November 14, 2024 at 11:13 pm

    Changing it from singular to plural was the one for me. Thank you Bob you handsome man you!

    Reply
  9. Nikhil says:
    March 3, 2025 at 6:12 am

    Great post tom really worked. I was struggling a lot for this but your post helped. Thank a lot!

    Reply
  10. Kyle says:
    March 27, 2025 at 1:40 pm

    Good Day, how would I update the “/systemusers(‘@{outputs(‘Start_and_wait_for_an_approval’)?[‘body/outcome’]}’)” when I update a row in a selected environment?

    I am trying to update the table when an approval has been completed using the outcome from the approval. It keeps saying: Bad Request – Error in query syntax.

    The output from the previous step is: /systemusers(‘Kyle User’)

    Reply
    1. Tom says:
      April 5, 2025 at 9:17 am

      Hello Kyle,
      the first part is the table you’re updating, the part in the brackets is ID of the row from that table that you want to store them. If you’re updating a user then it must be /systemusers(userGUID), not a string with task outcome.

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

πŸš€ Master Power Automate

Join 2,000+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

Working on an Approval process?

Use the Approval Process Template and the Task Delegation App to skip the hard part and deploy a fully functional approval solution on a SharePoint list in minutes! And then the next one, and the next one...

Approval Template Preview ✨ Learn more ✨

Turn ideas into flows with ease!

Grab the complete Power Automate Cheat Sheet Bundleβ€”everything you need to master expressions, SharePoint HTTP calls, and Graph API in Power Automate.

Cheat Sheet Bundle Preview ✨ Get the Cheat Sheets

Didn't find what you were looking for?
Need to adjust a solution to fit your needs?
Or would you just like to get an assistance from somebody with thousands of hours of experience with Power Automate?

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2025 Let's POWER Automate | Theme by SuperbThemes