cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rafia1
Helper II
Helper II

patching Blank() value when Updating People-Picker column.

Hi all!
I had an issue... I have a form that is attached with a SharePoint list..the list have 5 People column... when I am submitting the form it's working fine.. but when I am editing these people field and select nothing it's not updating the list and showing the previously selected person(I want it to set as null as I am doing when editing the form... How do I make these combo boxes to select the null?

5 REPLIES 5
Roverandom
Solution Supplier
Solution Supplier

Enable this option in your app:

Roverandom_0-1661441032672.png

Then, in your Patch function:

Patch(
    SPList,
    Defaults(SPList),
    {
        PersonField: {
            '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
            Department: Blank(),
            Claims: Blank(),
            DisplayName: If(IsBlank(DataCardValue5.Selected), Blank(), DataCardValue5.Selected.DisplayName),
            Email: Blank(),
            JobTitle: Blank(),
            Picture: Blank()
        }
    }
)


Hi! I hope I was helpfull. Please always mark the answer that helped you, so others who need it will find it faster.



Roverandom is a book by J.R.R Tolkien. I'm a big fan of his works and as Frodo, Aragorn or Gollum are already widely used, I decided to use this nickname.

@Roverandom thanks for your reply... yea I had turn that on... Hmm, it seems to be a resolver, but I was concerned that Defaults() is used to add a new record, isn't it? 

Roverandom
Solution Supplier
Solution Supplier

That's right. Use the LookUp function in place of Defaults to change an existing value.



Hi! I hope I was helpfull. Please always mark the answer that helped you, so others who need it will find it faster.



Roverandom is a book by J.R.R Tolkien. I'm a big fan of his works and as Frodo, Aragorn or Gollum are already widely used, I decided to use this nickname.

I tried it but it's not setting it blank as the values in the Form are coming from my gallery when it is in edit mode, hence the field is prepopulated, it's not setting it blank and patching the previous value instead... 

Hi @Rafia1 ,

 

Please try below method:

Patch(
    SPList,
    Gallery.Selected,
    {
        Field1: 
            If(
                IsBlank(PeoplePicker1.Selected.Mail), Blank(),
                {
                    Claims: "i:0#.f|membership|" & Lower(PeoplePicker1.Selected.Mail),
                    Department:"",
                    DisplayName: PeoplePicker1.Selected.DisplayName,
                    Email: PeoplePicker1.Selected.Mail,
                    JobTitle:"",
                    Picture: ""
                }
            ),
        Field2: 
            If(
                IsBlank(PeoplePicker2.Selected.Mail), Blank(),
                {
                    Claims: "i:0#.f|membership|" & Lower(PeoplePicker2.Selected.Mail),
                    Department:"",
                    DisplayName: PeoplePicker2.Selected.DisplayName,
                    Email: PeoplePicker2.Selected.Mail,
                    JobTitle:"",
                    Picture: ""
                }
            )
    }
)

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (4,675)