Introduction
Dataverse Lookup’s can be tricky in Power Automate, and even more so when updating multiple records and one of the values is blank. In the post we will show how to update a Dataverse Lookup with a blank value
The Problem
When adding or updating a dataverse record with a lookup you have the pass through the table EntitySetName in which your getting the GUID from, when you try and update a record with a null value you may come across the below error when you run the flow:
Updating Dataverse Record with Blank Lookup
To fix this we need to first check if we are actually passing a GUID or not first to do this we can use the Empty() expression. We also need to make sure if the GUID is empty that we are not including the EntitySetName as this is what brings up that error.
For this to work we can use Concat expression. If the GUID is empty enter null value otherwise we want to type in the EntitySetName followed by the GUID of the record
For this to work we can use Concat expression. If the GUID is empty enter null value otherwise we want to type in the EntitySetName followed by the GUID of the record
if(empty(outputs('List_rows_2')?['body/value']?[0]?['systemuserid']),'',
concat('systemusers(',outputs('List_rows_2')?['body/value']?[0]?['systemuserid'],')'))
Or
if(empty(outputs('List_rows_2')?['body/value']?[0]?['systemuserid']),null,
concat('systemusers(',outputs('List_rows_2')?['body/value']?[0]?['systemuserid'],')'))
The Result: