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

9 REPLIES 9
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".

 

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

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

Anonymous
Not applicable

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

Anonymous
Not applicable

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 @Anonymous,

 

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.

Anonymous
Not applicable

and what about single value people picker field? i also have issues, cannot clear it... after submitting the form the value still stays the same.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,329)