Hello All,
I am working on making a submission screen so that our Project Managers can record the participants of their weekly toolbox talks.
I have tried several formulas to try and patch the selected items (users) to my SharePoint list, but have been unable to successfully. I have only been able to patch the first selected user or, in some cases, none at all.
This is my current placeholder formula until I can find the right one:
Patch('Toolbox Talks Submissions',
Defaults('Toolbox Talks Submissions'),
{
Toolbox_x0020_Talk:{
Id: Gallery10.Selected.ID,
Value: Gallery10.Selected.TalkTitle
},
Participants: Gallery7_2.AllItems,
Usefulness: {Value: Radio1_21.Selected.Value}
}
)
I have also tried this formula to patch the participants:
ForAll(ComboBox1_1.SelectedItems,
{
'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims:"i:0#.f|membership|" & Mail,
Department:"",
DisplayName: DisplayName,
Email: Mail,
JobTitle:"",
Picture:""
})
This also did not work.
Is there a way to patch multiple selected people to a multi-select people picker column in SharePoint?
Solved! Go to Solution.
I would consider changing the Items property to:
Filter(Office365Users.SearchUserV2({searchTerm:"",top:35}).value, Department="Job Site")
As the SearchUser action has been deprecated.
For your Patch formula, it should be the following:
Patch('Toolbox Talks Submissions',
Defaults('Toolbox Talks Submissions'),
{
Toolbox_x0020_Talk: {Id: Gallery10.Selected.ID, Value: Gallery10.Selected.TalkTitle},
Participants:
ForAll(ComboBox1_1.SelectedItems,
{Claims:"i:0#.f|membership|" & Lower(Mail),
Department:"",
DisplayName: DisplayName,
Email: Mail,
JobTitle:"",
Picture:""
}
),
Usefulness: {Value: Radio1_21.Selected.Value
}
)
Assuming that Toolbox Talk is a Lookup column and Usefulness is a Choice column and, of course, that your Participants column is a multi-select person column.
First, what is the Items property of Combobox1_1 ?
Next, in one formula you are trying to patch the column with AllItems from a Gallery - is that intentional? I am not sure where your Gallery fits into this.
The Items property of ComboBox1_1 is this:
Filter(Office365Users.SearchUser({searchTerm:"",top:35}),Department="Job Site")
And yes the Gallery is there to display the people that have been selected. In that formula, I placed it there as a holder.
This is what the screen currently looks like:
I would consider changing the Items property to:
Filter(Office365Users.SearchUserV2({searchTerm:"",top:35}).value, Department="Job Site")
As the SearchUser action has been deprecated.
For your Patch formula, it should be the following:
Patch('Toolbox Talks Submissions',
Defaults('Toolbox Talks Submissions'),
{
Toolbox_x0020_Talk: {Id: Gallery10.Selected.ID, Value: Gallery10.Selected.TalkTitle},
Participants:
ForAll(ComboBox1_1.SelectedItems,
{Claims:"i:0#.f|membership|" & Lower(Mail),
Department:"",
DisplayName: DisplayName,
Email: Mail,
JobTitle:"",
Picture:""
}
),
Usefulness: {Value: Radio1_21.Selected.Value
}
)
Assuming that Toolbox Talk is a Lookup column and Usefulness is a Choice column and, of course, that your Participants column is a multi-select person column.
I just got an error message:
The record also did not patch to SharePoint whatsoever.
I have seen other users that have patched from a temporary collection. I have not used collections that much, but would this be a better solution?
No, a collection is of no use in this case, you already have the information you need in your controls, there is no sense in duplicating it again.
Your issue in that formula is with the user from your combobox. It is telling you that the user does not exist in SharePoint.
Can you narrow down to a particular selected user? If you select only one user in the combobox and then submit, if you get the error, can you look in the user profiles of your SharePoint admin to see if there is in fact that user or not?
It works and you were right! I had a few users added to the admin center that had yet to fully log into their account. It works with those who have. Great solution!! Thank you for all your help.
Hi @RandyHayes ,
i implemented your suggestion in my app but couldnet make it work
when patched im getting an error:
itried to collect the combo box content to use the collection in the patch and i doiiscovered that the collection is empty, the rows are collected but its empty, no data.
my items formula is: Office365Users.SearchUserV2({searchTerm:ComboAI_Owner.SearchText,top:10}).value
my patch formula is:
Patch('Action Items',
LookUp('Action Items',
ID=ThisItem.ID),
{
Title:TextInput2.Text,
Status:{
'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Value: DD_Approved_1.SelectedText.Value,
ID:ThisItem.ID},
Open_x0020_Date:ThisItem.Open_x0020_Date,
/* RiskID:{
'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Value: ThisItem.RiskID,
ID:ThisItem.ID},*/
Due_x0020_Date:DueDate2_2.SelectedDate,
AI_x0020_description:txtAI_Description.Text,
Notifications:Checkbox1.Value,
Assigned_x0020_to:ForAll(ComboAI_Owner.SelectedItems,
{Claims:"i:0#.f|membership|" & Mail,
Department:"",
DisplayName:"",
Email: "",
JobTitle:"",
Picture:""
})
}
)
if any additional data required, i will be happy to provide
will appreciate your response.
Eyal