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

How to add and remove user from multiuser field

I have a SharePoint List where I have one title column and one people picker column which is enabled for multiple selection. My SharePoint list have only single record in that my people picker column values are "A" and "B". I want to design a form in the PowerApps so that I have two button "Add my name" and "Delete my name". When logged in user will click on the "Add my name" his name will update to the "PowerApps people picker". It should not save as a new record. So now my people picker value is "A","B" and "my logged in user name". Like that when user will click on the "Delete my name" then my logged in user name should delete friom the people picker record.Is it possible. I just want to update my logged in name in the people picker field first record. My aim is not to add as a new record. In a single record only I want to update and delete my value.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: How to add and remove user from multiuser field

Hi @PadminiDeshudu3 ,

Try this:

1)add current user:

ClearCollect(DemoColl1,LookUp(MultiUserDemoList,Title="A").EmployeeName);
Patch(DemoColl1,Defaults(DemoColl1),{Claims:...,Depatrment:...,DisplayName:...,.....});
Patch(MultiUserDemoList,LookUp(MultiUserDemoList,Title="A"),{EmployeeName:DemoColl1})

2)delect current user:

ClearCollect(DemoColl1,LookUp(MultiUserDemoList,Title="A").EmployeeName);
RemoveIf(DemoColl1,DisplayName=User().FullName);
Patch(MultiUserDemoList,LookUp(MultiUserDemoList,Title="A"),{EmployeeName:DemoColl1})

 

Best regards,

 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Community Support Team
Community Support Team

Re: How to add and remove user from multiuser field

Hi @PadminiDeshudu3 ,

Since person is a complex data type, I'm afraid it's not supported to change its value by using button.

For now, you could only use combo box to select value to update person field.

I've made a test and found that patching value by enter value by yourself will not work:

ClearCollect(test,ComboBox1.SelectedItems);
Patch(test,Defaults(test),LookUp(Choices(survey.peo),DisplayName=User().FullName))

Combo box is the control that displays person field value.

survery is my list name, peo is my person field.

And the result is:8306.PNG

 

So, I suggest you just using combo box to update person field, not using buttons.

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
PadminiDeshudu3
Level: Powered On

Re: How to add and remove user from multiuser field

Thnk you soo much for reply. Sorry I didnot explain properly. I will give the screenshort so that I can explain my requirment .

detaily. Below is SharePoint list having two column one is title(default) and other one is people picker(enable multi selection in SP List)or "EmployeeName". I have a single record in SharePoint list.

Pic1.png

I have a PowerApps form where in the "Add" button control add the below rule. To save the logged in user name save to SharePoint multiselected people picker field(Employee Name).


Pic2.pngPowerApps add button

My logged in user name is Padmini so it is working fine. But now I have open the PowerApps form with other user name and click on the Add button. See in the below screenshort other name is saving.

But my requirment is I want to append the other user name in the EmployeeName column where title value is A. So I want in the "Employeename" column should display "PadminiKumari","PreetiSahu".

Like that when the other Office365 user will open the PowerApps form and click on "Add" then his logged in user name  suppose "xyz" should come in the "EmployeeName" column where title value is "A". Now I want my list column employee name should "PadminiKumari","Preeti Sahu" and "XYZ" as a single record.

Pic3.png

If you have any solution please share with me. 

I have one more requirment like add I want one more button in the powerApps form called delete. When logged in user click on it his his name will delte from the "EmployeeName" first record where title value is "A".

For example my logged in user name is padmini. I have opened the "powerApps" form using my credential and click on the "delete" button so my name should delete from the record, now my people picker have "Preeti" and "xyz".

Please help me to achieve my requirment

 

 

 

Community Support Team
Community Support Team

Re: How to add and remove user from multiuser field

Hi @PadminiDeshudu3 ,

Try this:

1)add current user:

ClearCollect(DemoColl1,LookUp(MultiUserDemoList,Title="A").EmployeeName);
Patch(DemoColl1,Defaults(DemoColl1),{Claims:...,Depatrment:...,DisplayName:...,.....});
Patch(MultiUserDemoList,LookUp(MultiUserDemoList,Title="A"),{EmployeeName:DemoColl1})

2)delect current user:

ClearCollect(DemoColl1,LookUp(MultiUserDemoList,Title="A").EmployeeName);
RemoveIf(DemoColl1,DisplayName=User().FullName);
Patch(MultiUserDemoList,LookUp(MultiUserDemoList,Title="A"),{EmployeeName:DemoColl1})

 

Best regards,

 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

PadminiDeshudu3
Level: Powered On

Re: How to add and remove user from multiuser field

Thank you soo much 

Best regards

Helpful resources

Announcements
thirdimage

Power Platform 24

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps 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

Top Solution Authors
Top Kudoed Authors
Users online (5,270)