cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

SharePoint Lookup fields cannot be cleared (set to BLANK) in PowerApps

Problem

 

When using a SharePoint list, once a lookup field has been assigned a value, clearing the value in a “Drop down” or “Combo box” in PowerApps forms does not reset it to BLANK and instead the initial value remains (basically there is no way to remove the assigned value). This is contrary to the correct behavior of a list’s default form (which happens to be an InfoPath form).
Using SubmitForm(…) or Patch(…) to update the record does not change the behavior.
This is a fundamental capability that needs to take priority to experimental features.
This problem and its workarounds have been reported many times by the PowerApps community.
Though workarounds exist, they are not always appropriate in a production environment – specially the use of an experimental feature which can change or disappear at any time.

 

Steps to reproduce

 

1. Create List REFERENCE
2. Create List MAIN
3. Add column R1 of type lookup to MAIN (select list REFERENCE, column Title)
4. Add record(1) to REFERENCE with any value in Title
5. Add record(1) to MAIN with any value in Title, and set R1 to record(1) in REFERENCE

 

NOTE: R1 in MAIN’s Record(1) has a value and shows the Title from Record(1) in REFERENCE

 

6. Edit Record(1) in MAIN and clear R1

 

NOTE: R1 in MAIN’s Record(1) no longer has a value and shows as blank in the list

CORRECT: R1 in MAIN’s Record(1) does not have a value, as it was cleared when edited

 

7. Select “PowerApps – Customize forms” for MAIN

 

NOTE: Title, R1, and Attachments fields show in the form

 

8. Remove the “Attachments” field from the form

 

NOTE: Notice that - other than removing the attachments field - no change has been made to the default form

 

9. Save and Publish the form, and close PowerApps
10. Refresh the MAIN list
11. Add record(2) to MAIN with any value in Title, and set R1 to record(1) in REFERENCE

 

NOTE: R1 in MAIN’s Record(2) has a value and shows the Title from Record(1) in REFERENCE

 

12. Edit Record(2) in MAIN and clear R1

 

NOTE: R1 in MAIN’s Record(2) still has its value unedited and shows the Title from Record(1) in REFERENCE

ERROR: R1 in MAIN’s Record(2) does should no longer have a value

 

Workarounds

 

Method 1:

 

ONLY if “Enforce relationship behavior” is not selected for R1:

MAIN’s Custom Form – R1 DataCard - Update method:

 

If (IsBlank(R1_DataCardValue1.Selected),
  {'@odata.type': "Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference", Id:-1, Value:Blank()},
  R1_DataCardValue1.Selected
)

Method 2:

 

Create a DUMMY record in REFERENCE, for example: a record with Title set to (None)
Select the record (None) as equivalent for a Lookup with no value

 

Method 3:

 

MAIN’s Custom Form - Settings – Advance Settings – Experimental Features

  Turn ON “Formula-level error management”

1 REPLY 1
Highlighted
Community Support
Community Support

Re: SharePoint Lookup fields cannot be cleared (set to BLANK) in PowerApps

Hi @NasserA 

 

Thanks for your effort and sharing. 

Could you please mark it as the answer? it would help more members find this quickly.

Sik

 

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (9,627)