cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vsolanon
Helper III
Helper III

Clear people picker field

Hello Experts!

 

I have a PowerApps that is linked to a SharePoint list. In the SP list I have a Person field which populate the name of the employees in my company. Since this is not a mandatory field, the user will be able to remove the person's name selected and leave this field in blank, however, I have not been able to achieve this.

 

Currently I have not been able to clear out the value stored in the People field. After selecting save in the PowerApp, the field is repopulated.

 

I will really appreciate any support 🙂

 

Thank you!

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
SimonPiquer
Continued Contributor
Continued Contributor

Hi,

 

Have you tried this solution from @joshnystrom

 

Note that it only seems to be working if the Person-field is set to "allow multiple values".

 

View solution in original post

Hey @SimonPiquer, thanks for calling @vsolanon's attention to that post.

 

Unfortunately, you are correct, this approach depends on the "person" field being configured to allow multiple selections. In this other thread - https://powerusers.microsoft.com/t5/Building-Power-Apps/Clearing-out-people-picker-field/m-p/258564#... - I had tested and clarified that Date and single-Person fields were still reliant on the use of the "Formula-level error management" experimental feature, at least at that time.

 

To be clear @vsolanon, if you enable the "Formula-level error management" experimental feature in your app's Advanced settings, save, close and relaunch editing, you should be able to clear a single-selection people field.

PowerApps Experimental Features.PNG

 

And, as I mentioned in that thread, your update may need to happen by way of a Patch statement rather than using SubmitForm(). More details about how are present in the referenced threads. 

 

Good luck!

Josh

View solution in original post

8 REPLIES 8
SimonPiquer
Continued Contributor
Continued Contributor

Hi,

 

Have you tried this solution from @joshnystrom

 

Note that it only seems to be working if the Person-field is set to "allow multiple values".

 

View solution in original post

Hey @SimonPiquer, thanks for calling @vsolanon's attention to that post.

 

Unfortunately, you are correct, this approach depends on the "person" field being configured to allow multiple selections. In this other thread - https://powerusers.microsoft.com/t5/Building-Power-Apps/Clearing-out-people-picker-field/m-p/258564#... - I had tested and clarified that Date and single-Person fields were still reliant on the use of the "Formula-level error management" experimental feature, at least at that time.

 

To be clear @vsolanon, if you enable the "Formula-level error management" experimental feature in your app's Advanced settings, save, close and relaunch editing, you should be able to clear a single-selection people field.

PowerApps Experimental Features.PNG

 

And, as I mentioned in that thread, your update may need to happen by way of a Patch statement rather than using SubmitForm(). More details about how are present in the referenced threads. 

 

Good luck!

Josh

View solution in original post

Hi @joshnystrom @SimonPiquer Thank you very much for the information, it works like a charm 🙂

cmurray
Advocate I
Advocate I

Hi @joshnystrom and @SimonPiquer .

I have a similar need that is not working. I need to patch a SharePoint single-selection person field to blank.

Below is the portion of the patch that I had hoped would set the field to blank.

I have turned on "Formula-level error management" (and closed and re-opened).

Any advice please?

        'Director name':
        {
            '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
            Claims:Blank(),
            Department:Blank(),
            DisplayName:Blank(),
            Email:Blank(),
            JobTitle:Blank(),
            Picture:Blank()
        },

Thanks,

Carla

To add to my query, I have also tried setting a blankperson variable, then patching that variable into the person field as shown below. Also no luck.

Set(
    varBlankPerson,
    {
        Claims: Blank(),
        Department: Blank(),
        DisplayName: Blank(),
        Email: Blank(),
        JobTitle: Blank(),
        Picture: Blank()
    }
);

Then,

Patch(
    'Business plan log',
    varRecord,
    {
        'Director name': varBlankPerson
    }
)

 

Hi Carla @cmurray,

 

Sorry for not responding to your request on this thread. Just wondering if you're still facing this challenge and whether you can provide any additional information, as I can try to assist now.

 

Thank you,

Josh

SaiTeja444
New Member

Create a flag to achieve it.

Step 1: OnStart of the app create Set(ResetFlag,false);

Step 2: In textbox (which is connected to office 365 users with multiple user), Reset property: false(default) - change it to ResetFlag

Step 3: On your button click (Submit button) -  Onselect property: - UpdateContext({ResetFlag: !ResetFlag})

 

 

benjaminkenobi
Regular Visitor

I tried all of the solutions in this thread for a single-user field and none worked. What DID work was:

  1. Turn on Formula-Level Error Management in Experimental Features.
  2. Change the update property of the card to:
If(
!IsBlank(DataCardValue7.Selected),
DataCardValue7.Selected,
Blank()
)

Where DataCardValue7 is your single-person people picker.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,644)