Setting Dataverse LookUp Value to Null Using Power Automate

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
				
					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:

 

 

Like this post? Why not share it!

LinkedIn
WhatsApp
Facebook
Reddit
X
Email

View more blog posts

Trigger Power Automate Flow From Canvas App

4 min read

Read this blog

Creating A Canvas App

3 min read

Read this blog

Rest API ‘GET’ Requests in Power Automate

2 min read

Read this blog

Create Dataverse Form

4 min read

Read this blog

Get In Touch

Let’s talk. Send us a message, and we’ll help you explore the best Power Platform solution for your business

We can turn your mondain tasks into effective workflows, saving you and your business time and money