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
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:
JS code:
function test(primaryControl) {
primaryControl.getAttribute("FieldName").setValue(null)
}
Add Parmeter
Best Regards,
Bof
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
mmbr1606
22
Super User 2025 Season 1
stampcoin
17
Michael E. Gernaey
15
Super User 2025 Season 1