I’m building an order processing automation in Power Automate that updates Dataverse lookup fields based on customer selection. The flow works fine when I hardcode lookup values during testing, but fails in production when trying to use dynamic values from the trigger.
The error occurs at the “Update a row” action:
Error: Invalid lookup reference
Details: The lookup field 'Customer' requires a valid GUID
Action: Update Order Record
Status Code: 400
The ID mapping seems correct - I’m extracting the GUID from the trigger output and passing it to the lookup field. Flow designer config shows the field is properly mapped to the Dataverse table relationship. However, lookup field validation keeps rejecting the dynamic value even though the same GUID works when manually entered.
This is causing order processing delays since failed flows require manual intervention. Any insights on proper dynamic lookup handling?
Also verify that your flow’s connection context has proper permissions to read the related entity. Even if the GUID is valid, the flow will fail if it can’t validate the lookup reference against the target table. Check the connection used in your “Update a row” action - it needs read access to both the Order table and the Customer table to resolve lookup relationships properly.
I’m using the dynamic content picker to select the Customer GUID from the trigger. Should I be using a Compose action to format it differently? The dynamic content shows as “Customer Identifier” and appears to be a valid GUID when I test the flow. Not sure where to add the odata.type formatting you mentioned.
The issue is likely with how you’re formatting the lookup value. Dataverse lookup fields require a specific JSON format, not just the GUID. You need to wrap it in an object with the proper entity reference syntax. Check if you’re using the correct format: {“@odata.type”: “Microsoft.Dynamics.CRM.account”, “accountid”: “your-guid-here”}. The entity logical name and ID field name must match exactly.
I checked permissions and the service account has full access to both tables. I tried the expression with underscore prefix but still getting validation errors. Is there a way to test the exact value being passed to the lookup field? The flow runs show the GUID in the inputs, but maybe there’s hidden formatting that’s causing the rejection?
Enable flow analytics and check the raw HTTP request payload. That will show you exactly what’s being sent to Dataverse. My guess is there’s either whitespace in the GUID or the field mapping is pointing to the wrong property. You might need to use a Parse JSON action first to properly extract the lookup value from your trigger output.