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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Unable to Clear Value ...
Power Automate
Answered

Unable to Clear Value From SharePoint Lookup Column

(0) ShareShare
ReportReport
Posted on by 18

I am finding it impossible to clear a value from a SharePoint List lookup column using a Power Automate flow.

 

Since there is apparently no supported way to do this through the Update Item action, I have tried doing so via an HTTP request (a solution recommended in other discussions online). 

 

All of the available guidance on the web says to set the 'Id' value of the column to -1 in order to clear it. (This is the solution I have tried as you can see in the screenshot provided.) Basically, this never works. While the flow completes successfully and the request is being processed by the server (with a 204 response), the value in the list item is never changed. 

 

Through testing, I have determined that if I disable referential integrity checks for the column, the POST will succeed and the column Id value does indeed get changed to -1.  This has the effect of "clearing" the visible field on the front-end (which is maybe where all this misleading web guidance is coming from). But of course, this is just an illusion: -1 is not the same as no value. Plus, even if I could live with this, it is deficient as a work-around, since having referential integrity enabled is important to our business process.

 

Is there really no way to completely remove a lookup column value from a SharePoint list using Power Automate?  In 2023? 

 

Thank you in advance for any suggestions.

 

 

 

Screenshot 2023-10-19 111713.png
Categories:
I have the same question (0)
  • creativeopinion Profile Picture
    10,508 Moderator on at

    @Silversee You can use the Update Item action. The look up field requires you to input the look up item ID. You can use an expression to turn the ID into a negative integer which will clear the look up column.

    creativeopinion_1-1697747296361.png

     

    Use the expression below. It will subtract the look up ID from 0—returning a negative integer.

    sub(0, int([insert your lookup id dynamic content here))

     

    creativeopinion_0-1697747214393.png

     

    Hope this helps!


    If I helped you solve your problem—please mark my post as a solution ✅.
    Consider giving me a 👍 if you liked my response!

    👉Watch my tutorials on YouTube
    👉Tips and Tricks on TikTok

     

  • Silversee Profile Picture
    18 on at

    @creativeopinion: thank you for the suggestion. However, this does not work. You can't use the Update Item action to set a negative integer on the field when referential integrity is enabled in SharePoint. It always fails with the following error: "The list item could not be inserted or updated because invalid lookup values were found for the following field(s) in the list: [Organization]."

     

    In any case, there is no practical difference between your suggestion and using -1; it is just substituting one negative integer for another. After trying various way to use 'null' which was impossible, my original field formula for the Update Item action using a -1 is here, followed by your suggestion:

     

    if(equals(variables('OrganizationID'),0),-1,variables('OrganizationID'))
    
    if(equals(variables('OrganizationID'),0),sub(0,outputs('Get_matching_contact')?['body/Organization/Id']),variables('OrganizationID'))

     

    The first formula results in a -1 being used; the second in a value of -58.  Either one throws this error and leaves the original data in the field. This is what originally led to trying the HTTP request. The HTTP request also fails to change the value, but it fails silently (which at least has the benefit of allowing the flow to complete).

     

    Disabling referential integrity for the column in SharePoint (see screenshot if you are unfamiliar with this) does indeed allow this to work. But then, you risk having inconsistent data in your database. For an example using my data model, an Organization could be deleted while still being referenced by Contact records, creating "orphans" in the database and introducing all kinds of problems. (Even so, SharePoint is not a real relational database and its referential integrity support is limited: you can only restrict or cascade the delete operation; there is no "set null" behavior, which is what would be desired in many cases. But we use the tools we have.)

     

    Supposing we disable referential integrity for testing, then as you can see from the attached "Invalid Data" screenshot, using a negative integer in Power Automate does not actually clear the field; it merely sets it to an inconsistent value. We have front-end apps working against this SharePoint data in Microsoft Access. There are innumerable IsNull() checks embedded in queries, forms, reports, etc. that would all fail with data like this.

     

    Unless I am missing something, I have to conclude that there is no current way to truly null a SharePoint Lookup column using Power Automate, and if SharePoint referential integrity is enabled, no way to even "fake it" (using a negative integer). 

     

    Microsoft should look into this. 

    SharePoint Referential Integrity.png
    Invalid Data.png
  • Verified answer
    efialttes Profile Picture
    14,756 on at

    Hi @Silversee 
    I am assuming your LookUp column config is somehow similar to the following screenshot, right?

    efialttes_0-1697801056868.png

     


    If so, I managed to delete LookUp Column value by means of the following:

    efialttes_2-1697801199112.png

     


    Tricky challenge, hope this helps

    efialttes_1-1697801145143.png

     


    ============================

  • creativeopinion Profile Picture
    10,508 Moderator on at

    @Silversee I tried it on my environment and didn't receive any errors—but maybe my environment is set up differently than yours. Sorry I couldn't help.

    creativeopinion_0-1697814790997.png

     

    creativeopinion_1-1697814816595.png

     

    I checked the SP list and it cleared the lookup column. 

     

  • Silversee Profile Picture
    18 on at

    Thank you for trying, I do appreciate it.

  • Silversee Profile Picture
    18 on at

    @efialttes: thank you, this did the trick!

     

    I had to change my HTTP request type from POST to PATCH and remove the 'accept' line from the headers, and this apparently allowed the field to accept a null value, which it would not do before. And the data was successfully cleared. 

     

    I had almost given up. Thanks again.

     

     

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 516

#2
Valantis Profile Picture

Valantis 477

#3
Vish WR Profile Picture

Vish WR 470

Last 30 days Overall leaderboard