web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Saving multiple people...
Power Apps
Unanswered

Saving multiple people from combo box with Patch

(0) ShareShare
ReportReport
Posted on by 97
Hi there,
 
I am having issues using a Patch command in Power Apps.
 
I had it working, then added another combo box to my form, that saved multiple people (from O365) - and it stopped working.
 
I do this exact same thing in another app I've created, and it works great, so I copied the code and pasted it into my patch command.
It won't work, and I can't see where I may have gone wrong.

If I comment out the code to patch my Authors field (highlighted below), everything works great - when I don't have the code commented out, it errors on me.
 
But as I said, I copied this exact code from my other app and it works great.
 
Here is my patch code:
 
Patch(
    'MySharepointList',
    LookUp('MySharepointList', ID = galNotes.Selected.ID),
    {   EntryDate:dtNewEntry.SelectedDate,
        Comments: txtNewEntryNotes.Text,
 
        StaffMember: {
            Claims: cboUserList.Selected.UserPrincipalName,
            DisplayName: cboUserList.Selected.DisplayName,
            Email: cboUserList.Selected.Mail,
            Picture: "",
            Department:cboUserList.Selected.Department,
            JobTitle:cboUserList.Selected.JobTitle
        },
 
        Authors: ForAll(
            cboAuthor.SelectedItems As _Data2,
             {
           Claims:"i:0#.f|membership|" & Lower(_Data2.Mail),
           Department: "",
           DisplayName: _Data2.DisplayName,
           Email: _Data2.Mail,
           JobTitle: "",
           Picture: ""      
             })
 
    })
   
 
Thanks in advance for any help!
Amber
 
Categories:
I have the same question (0)
  • developerAJ Profile Picture
    4,750 on at
    what is data source of the combo box meaning Items property
     
    If you did exact way as the other app but still not working could be an issue with combo box. There are issues happening with modern combo box. Microsoft is planning to fix modern control issues soon. If you are using modern, try classic and see
     
    try debugging by adding this code on button and collect
     Authors: ForAll(
                cboAuthor.SelectedItems As _Data2,
                 {
               Claims:"i:0#.f|membership|" & Lower(_Data2.Mail),
               Department: "",
               DisplayName: _Data2.DisplayName,
               Email: _Data2.Mail,
               JobTitle: "",
               Picture: ""      
                 })
    and see if data is populated
  • WarrenBelz Profile Picture
    153,138 Most Valuable Professional on at
    Firstly @developerAJ is correct in everything noted. I have a blog on the various options here, so you might run throught it and check everything else lines up, in particular
    • Are the Items of the second Combo Box based on Office365Users.SearchUser like the other one
    • Is the Person field being written to by the second Combo Box also multiple-value.
  • AH-22100006-0 Profile Picture
    97 on at
    Thanks for the responses! 
    @developerAJ The items property of the combobox is:
     
    Office365Users.SearchUserV2(
          {
             searchTerm: Self.SearchText,
             isSearchTermRequired: false,
             accountEnabled: true,
             top: 999
          }
       ).value
     
    (same as in my other, working app).
     
    I used to see options - to use modern or classic combobox - but I only see one choice "Combo box" - just by looking at it, I think it's a classic control.
     
    Your suggestions for debugging - how do I do that? How do I test to see if the data is populated?
     
     
     
  • AH-22100006-0 Profile Picture
    97 on at
    @WarrenBelz the items property is almost the same for both - the only difference is I don't have a filter on this one.
     
    My working combo box has the following for Items property:
    Filter(
       Office365Users.SearchUserV2(
          {
             searchTerm: Self.SearchText,
             isSearchTermRequired: false,
             accountEnabled: true,
             top: 999
          }
       ).value,
       Department = "Computer Services"
    )
     
    Whereas the non-working (new) combo box just has:
    Office365Users.SearchUserV2(
          {
             searchTerm: Self.SearchText,
             isSearchTermRequired: false,
             accountEnabled: true,
             top: 999
          }
       ).value
     
     
    Yes, the person field being written to is also multiple-value.
     
    Cheers,
    Amber
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 740 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 342 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard