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 / Use Office365Users.Sea...
Power Apps
Unanswered

Use Office365Users.SearchUserV2() with a multi-selct people picker

(1) ShareShare
ReportReport
Posted on by 37
What is the correct set up for each property listed below when using Office365Users.SearchUserV2() with a multi-select people picker field within a Power apps form?
 
Note: SharePoint list is a multi-select person field 
Should a drop down or combobox be used in the Power Apps form
 -Item
 -DefaultSelectedItems
 -Update
 - any other properties that are required to patch a SP list in new and edit modes.

Hows does one Patch a multi-selct people picker field to Sharepoint list in new mode and edit mode
 
There is no documentation that tells the full story of a form field using Office365Users.SearchUserV2()with a multi-select people picker field
 
As you can see i need help!!!
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at
    The main issue here is that the Office365.SearchUser function returns a slightly different schema to the Person field, so the Update of the Data Card would be
    ForAll(
       ComboBoxName.SelectedItems As _Items,
       {
          Claims: "i:0#.f|membership|: & Lower(_Items.Mail),
          Department: "",
          DisplayName: _Items.DisplayName,
          Email: _Items.Mail,
          JobTitle: "",
          Picture: ""
       }
    )
    Then the DefaultSelectedItems of the Combo Box
    ForAll(
       ThisItem.YourPersonFieldName As _Items,
       {
          DisplayName: _Items.DisplayName,
          Mail: _Items.Email
       }
    )
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    Buy me a coffee
  • DC-18082037-0 Profile Picture
    37 on at
    Thank you for taking the time Warren.  How does one PATCH this field
  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at
    Same code
    Patch(
       DataSource,
       LookUp(
          Datasource,
          . . . . . .
       ),
       {
          PersonFieldName:
          ForAll(
             ComboBoxName.SelectedItems As _Items,
             {
                Claims: "i:0#.f|membership|: & Lower(_Items.Mail),
                Department: "",
                DisplayName: _Items.DisplayName,
                Email: _Items.Mail,
                JobTitle: "",
                Picture: ""
             }
          )
       }
    )

    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    Buy me a coffee
  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at
    A quick follow-up to see if you received the answer you were looking for or if you need further assistance.
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps   
  • Larifogo Profile Picture
    10 on at
    @WarrenBelz I also have the same issue, but your resolution is not solving, unfortunatelly.

    Here is my CB Items property:
    Filter(
        UsuáriosdoOffice365.SearchUserV2(
            {
                isSearchTermRequired: false;
                searchTerm: (Self.SearchText)
            }
        ).value;
        AccountEnabled = true;
        Not("#EXT#" in UserPrincipalName);
        Not("Test" in DisplayName)
    )
     
    And here's the button OnSelect property:
     
    Patch(
        '📝 FUP - 2.2';
        GalleryBU.Selected;
        {
            Title: "";
            History_PendingTasks: ("(" & Now() & ") " & User().FullName & ": " & RichTextEditor1.HtmlText & Char(13) & GalleryBU.Selected.History_PendingTasks);
            Task_responsible: ForAll(
                CB_TaskHolders.SelectedItems As aPerson;
                {
                    '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser";
                    Claims: "i:0#.f|membership|" & Lower(aPerson.Mail);
                    Department: "";
                    DisplayName: aPerson.DisplayName;
                    Email: aPerson.Mail;
                    JobTitle: "";
                    Picture: ""
                }
            )
        }
    )


    Coded as it is, there are no error flags, but whenever I try to test it out, an error saying "The requested operation is not valid" appears
  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at
    Firstly the multi-person Patch schema is correct except you do not need the '@odata.type' reference any more. You can also do a more specific reference with the ID as below, but I do not think that is your issue. Have you tested sending the Person field on its own as the error may be in one of the other field references.
    Patch(
       '📝 FUP - 2.2';
       {
          ID: GalleryBU.Selected.ID;
          Title: "";
          History_PendingTasks: ("(" & Now() & ") " & User().FullName & ": " & RichTextEditor1.HtmlText & Char(13) & GalleryBU.Selected.History_PendingTasks);
          Task_responsible: 
          ForAll(
             CB_TaskHolders.SelectedItems As aPerson;
             {
                Claims: "i:0#.f|membership|" & Lower(aPerson.Mail);
                Department: "";
                DisplayName: aPerson.DisplayName;
                Email: aPerson.Mail;
                JobTitle: "";
                Picture: ""
             }
          )
       }
    )
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn    Buy me a coffee

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard