cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FrancisL
Level: Powered On

Re: Clearing out people picker field

I also have tried everything and I am unable to Patch an empty/blank Person to SPL.

Please this is something we really need. Any news on when we can get this working?

sjcitpro
Level: Powered On

Re: Clearing out people picker field

joshnystrom
Level 8

Re: Clearing out people picker field

Hi @sjcitpro and @FrancisL,

 

Really sorry for the delay in responding and the missed information in my solution!

 

My writeup was built around People pickers that support multiple selections and I didn't end up testing the other types. I expect your fields are single Person fields, meaning you'll have to use this form of the variable instead:

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

(Note the "Table()" function wrapping the properties was removed. The original variable would be better named BlankPeople...)

 

 

Hope this helps! 

Josh

panand99
Level 10

Re: Clearing out people picker field

Hello @v-xida-msft 

 

Is there any solution for this question.

 

I`ve tried it with below formula but no effect.

 

 

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

 

Patch(RequestApprovals,galLineApprovals.Selected,{RA_BackupApprover:BlankPerson})

 

 

joshnystrom
Level 8

Re: Clearing out people picker field

Hi @panand99,

I'll start by recommending that you remove '@odata.type':[...], simply because it does not seem to be required and I don't know enough about the applicable types to be sure that it's not a confounder. 

In your Patch, you've specified "galLineApprovals.Selected" as the target record. To avoid any assumptions - are you able to successfully patch other columns using that value?

Also, as a debugging aide, I'd recommend wrapping your Patch statement with "Set(PatchResult,<PatchStatement>)" and placing a label onscreen with 

"PatchResult: " & PatchResult.ID

as its Text. This will give you immediate feedback as to whether the SharePoint action was successful, and that the correct record is being targetted.

Lastly, please confirm that "Allow multiple selections" is not enabled for the "RA_BackupApprover" column. If multiple selections are allowed, you will instead have to use a form like

Set(BlankPeople,Table(Claims:Blank(),DisplayName:Blank(),Email:Blank(),Department:Blank(),Picture:Blank(),JobTitle:Blank()}));

In fact, just in typing that, I realize this is likely the reason you are not having success - I just noticed that your "Set(BlankPerson[...]" string still shows the extra set of ( ) from the Table function. Please use 

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

instead, where only { } enclose the variable properties and you should find success.

Good luck, let us know how it goes!

Josh

FrancisL
Level: Powered On

Re: Clearing out people picker field

Sorry Josh but your solution is not working for me. It works for you?

 

Even if I Patch directly with Blank(), it doesn't blank the person. It does work in the sense that there is now error and the window close like it should and returns to SharePoint. I read somewhere that it treats the blanks as "No change" is required for that record. It's simply a missing feature that MANY people are waiting for. I can't even blank a date field either.

 

Patch(
        Test,
        {ID:Value(DataCardValue4.Text)},
            {
                Title:"Edited",
                Person: {
                    Claims:Blank(),
                    Department:Blank(),
                    DisplayName:Blank(),
                    Email:Blank(),
                    JobTitle:Blank(),
                    Picture:Blank()
                }
            }
)





 

 

 

 

joshnystrom
Level 8

Re: Clearing out people picker field

Hi @FrancisL,

Thank you for prompting me about this again. Sadly, revisiting my testing of this, it seems my test last week of a BlankPerson (single-select Person field clearing) was done on a test app where I'd left the experimental "Formula-Level Error Management" feature enabled:

FLEM2.JPG

 

 

 

[Start a new editing session after enabling or disabling this feature.]

 

So, while yes, BlankPeople (An empty table) is working for me without this feature, you are right in your assertion that this approach does not work for these Person fields where multiple selections are not allowed. Smiley Frustrated Such fields do work with that feature enabled and my experience has been that you can remove much of the complexity from the Patch - you can simply patch from a form's inputs and any blanks will be respected.

A couple of notable items here:

1) Just as in SharePoint, removing a date from a PowerApps date picker once it has been given a value does not seem possible. So, while the .SelectedDate property of a blank date picker can be used to patch directly to blank, you might have to get crafty around when you need to do that - that is, how does a user tell the app that the pre-populated date is to be cleared? (And then you'll instead patch with the .SelectedDate of a hidden control or something like that)

2) SubmitForm() still doesn't seem to support this 100% - I can clear LookUps and Dates, but single Person pickers just reset to whatever is in SharePoint. You still need to Patch.

 

Ultimately, the enhanced functionality we experience when that experimental feature is enabled suggests that Microsoft is both aware of these limitations, and working to remove them. However, being that the limitations aren't referenced directly within the name or description of the "Formula-Level Error Management" feature, it's not clear when we can expect a general release of this behaviour.

TL;DR: Single Person pickers and Date fields are still the insurmountable SharePoint fields for clearing with out-of-the-box features. Going the longway of a RestAPI Flow or using the experimental "Formula-Level Error Management" feature to patch are still the solutions for clearing such fields. I've done no testing of anything Group-picker.

 

@panand99, unfortunately, this applies to your above question as well. My confidence that BlankPerson worked was unfounded and the experimental feature is needed.

 

Hope this helps!

Josh

FrancisL
Level: Powered On

Re: Clearing out people picker field

Thank you Josh.

 

What I have done is created a "removed@blablabla.com" Office365 email so that it shows "removed" in the People picker when I want to patch a blank as a temporary solution.

joshnystrom
Level 8

Re: Clearing out people picker field

I like that Francis - just be careful you're not sending Approvals to "Removed" Smiley Tongue

Hopefully such band-aid fixes won't be necessary for much longer!

Highlighted
sjcitpro
Level: Powered On

Re: Clearing out people picker field

I used the Flow technique.

 

In the PowerApp Gallery: OnSelect 'ClearEmail'.Run(ThisItem.ID); Refresh(Hardware)

 

Untitled.jpg

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 300 members 5,660 guests
Please welcome our newest community members: