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 Apps / Clear Lookup Column re...
Power Apps
Answered

Clear Lookup Column reference using Power Fx Commands

(0) ShareShare
ReportReport
Posted on by 230

Hi all,

about new Command Apps (Customization Buttons), I need a button able to clear (set null) a lookup field.

https://docs.microsoft.com/en-us/powerapps/maker/model-driven-apps/commanding-use-powerfx

 

How can I do it using the Power Fx commands? Note: I don't want to use JavaScript. 

 

My first tentative was this expression: 

Patch(Leads,Self.Selected.Item,{'Lookup Column': Blank()});

 

but the Blank() command doesn't work: no reference item clear (it tested it after publishing all customizations).  

 

Unfortunately, there is no Null() function like in Power Automate. 

 

David 

I have the same question (0)
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @David_Pezzoli :

    The key is that under normal circumstances, such formulas cannot take effect in Canvas (Usually Blank() cannot be used to update a field).

    You could try Unrelate in stead of Patch:

    I assume there are Two Tables Releatedtable and ThisTable,the relationship between this two tables is 1:M.And then you could set the Commands in the "ThisTable":

    For example:

    Unrelate(
     LookUp(ReleatedTable,Name=Self.Selected.Item.ReleatedTable.Name).ThisTable,
     Self.Selected.Item
    )

    I think this link will help you a lot:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-relate-unrelate

    Best Regards,

    Bof

  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @David_Pezzoli :

    Power Fx Command is a preview function, so I suggest you use the solution that wants to be more stable JS way:

    vbofengmsft_0-1635759315042.png

    vbofengmsft_2-1635759532926.png

    vbofengmsft_3-1635759542894.png

    JS code:

     

    function test(primaryControl) {
    primaryControl.getAttribute("FieldName").setValue(null)
    }

     

    Add Parmeter

    vbofengmsft_1-1635759493881.png

    Best Regards,

    Bof

     

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 Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard