web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Can't Pass null value ...
Power Automate
Unanswered

Can't Pass null value to the Lookup field in Dataverse

(0) ShareShare
ReportReport
Posted on by 208

I am trying to pass the null value to the lookup field using the Power Automate.

 

I am using the below expression.

if(not(empty(variables('varEvent'))),concat('hso_events(',variables('varEvent'),')'),'')
 
This is still giving the below error.
The supplied reference link -- -- is invalid. Expecting a reference link of the form /entityset(key).
 
Any help would be appreciated.

 

Categories:
I have the same question (0)
  • rikdekoning Profile Picture
    281 on at

    Try using int('-1') inside your expression instead of '':

    if(not(empty(variables('varEvent'))),concat('hso_events(',variables('varEvent'),')'),int('-1'))

    Lookup fields are weird and the only way to clear them is to provide -1 as lookup ID. '' is just an empty string and won't be processed, so it will keep the current value.

  • Linn Zaw Win Profile Picture
    2,996 on at

    @Naveen_772 

    Instead of an empty string, you can set a null value. Please refer to my blog post for more details.

    https://linnzawwin.blogspot.com/2020/07/how-to-set-lookup-fields-with-null.html#updatenull

     

    Here's the updated expression.

    if(
    	not(empty(variables('varEvent'))),
    	concat
    	(
    		'hso_events(',
    		variables('varEvent'),
    		')'
    	),
    	null
    )

     

     

  • looblylu25 Profile Picture
    2 on at

    @LinnZawWin Hi Linn, I've used your expression, which works when you need to set NULL is the actual value being passed is null, but what if the value is NOT null - this expression does not set the value to the field.

     

    If I use the standard of 

    looblylu25_0-1694016406237.png

    If the Donor(Value) is null, this expression fails with the error: The supplied reference link -- -- is invalid. Expecting a reference link of the form /entityset(key) - therefore you need an expression that will pass NULL or pass the actual value in the field. The expression I am using is:

    if(empty(triggerOutputs()?['body/_msi_backdonor_value']),'',concat('/accounts/(',triggerOutputs()?['body/_msi_backdonor_value'],')'))

     

    It works in that if the field is NULL, nothing is added to Dataverse, but it also doesn't add a value if there is data.

     

    Any ideas please? Many thanks, Lucia

  • Linn Zaw Win Profile Picture
    2,996 on at

    @looblylu25 

    I guess you are mixing up the different syntax of setting the null value.

    For your case, you are using the / syntax. e.g.

    /accounts/«GUIDValue»

    If that is the case, your expression should be as follows without the bracket characters '(' or ')'

    if(empty(triggerOutputs()?['body/_msi_backdonor_value']), '', concat('/accounts/', triggerOutputs()?['body/_msi_backdonor_value']))

    I am not sure if that will work because I have never used that syntax to set the lookup value.

     

    In my blog post, I am using the () syntax. e.g.

    accounts(«GUIDValue»)

    In that case, your expression should be as follows without the '/' character.

    if(empty(triggerOutputs()?['body/_msi_backdonor_value']), '', concat('accounts(', triggerOutputs()?['body/_msi_backdonor_value'], ')'))

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 307 Super User 2026 Season 1

#2
David_MA Profile Picture

David_MA 269 Super User 2026 Season 1

#3
Power Platform 1919 Profile Picture

Power Platform 1919 115 Super User 2026 Season 1

Last 30 days Overall leaderboard