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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / ComboBox, Single & Mul...
Power Apps
Answered

ComboBox, Single & Multi-Person, DefaultSelectedItems and Patch NOT in a form - Example

(2) ShareShare
ReportReport
Posted on by 219

This has taken me days to work out (because of my own typos), mainly through trying to piece it together but also through the community board. I thought I'd present it like this from my own notes to help others. If you disagree then please provide feedback. 
I will say that one of the things that really got me was Mail vs. Email. Oh boy, was that an epiphany, SP stores it as Email while the table needed in Office365 is Mail.

 

This is an example for a Power App - Canvas App - with a ComboBox directly on the canvas and not in a form. The data connection is to a SP List.

 

Single Person is a SP Person/People Column (only allows single entry)

Multiple Person is a SP Person/People Column (allows multiple entries)

 

Property

Single Person

Multiple Person

ComboBox Name

ComboBox1

ComboBox2_1

DefaultSelectedItems

Office365Users.SearchUser({searchTerm: varItem.PersonSingle.Email})

 

---Or---

 

{

    Claims:"i:0#.f|membership|" & Lower(varItem.PersonSingle.Email),

    Department:"",

    DisplayName:varItem.PersonSingle.DisplayName,

    Mail:varItem.PersonSingle.Email,

    JobTitle:".",

    Picture:"."

}

 

ForAll(varItem.PersonMultiple,

{

    Claims:"i:0#.f|membership|" & Lower(Email),

    Department:"",

    DisplayName: DisplayName,

    Mail:Email,

    JobTitle:".",

    Picture:"."

})

Items

Office365Users.SearchUser({searchTerm: ComboBox1.SearchText})

Office365Users.SearchUser({searchTerm: ComboBox2_1.SearchText})

DisplayFields

["DisplayName"]

["DisplayName"]

IsSearchable

true

true

SearchFields

["DisplayName"]

["DisplayName"]

SelectMultiple

false

true

Patch (triggered by a button)

Patch(

    'Test List',

    LookUp(

        'Test List',

        ID = varItem.ID

    ),

    {

        PersonSingle: {

            Claims:"i:0#.f|membership|" & Lower(ComboBox1.Selected.Mail),

            Department: "",

            DisplayName: ComboBox1.Selected.DisplayName,

            Email: Lower(ComboBox1.Selected.Mail),

            JobTitle: "",

            Picture: ""

        }

    }

);

Patch(

    'Test List',

    LookUp(

        'Test List',

        ID = varItem.ID

    ),

    {

        PersonMultiple: ForAll(

            ComboBox2_1.SelectedItems,

            {

                

Claims: "i:0#.f|membership|" & Lower(Mail),

                Department: "",

                DisplayName: DisplayName,

                Email: Mail,

                JobTitle: ".",

                Picture: "."

            }

        )

    }

);

 

Lastly an example of combining the single and multiple patch as a single patch

 

Patch(

    'Test List',

    LookUp(

        'Test List',

        ID = varItem.ID

    ),

    {

        PersonSingle: {

            Claims: "i:0#.f|membership|" & Lower(ComboBox1.Selected.Mail),

            Department: "",

            DisplayName: ComboBox1.Selected.DisplayName,

            Email: ComboBox1.Selected.Mail,

            JobTitle: "",

            Picture: ""

        },

        PersonMultiple: ForAll(ComboBox2_1.SelectedItems,{

                    Claims: "i:0#.f|membership|" & Lower(Mail),

                Department: "",

                DisplayName: DisplayName,

                Email: Mail,

                JobTitle: ".",

                Picture: "."

        })     

    }

);

Categories:
I have the same question (0)
  • Verified answer
    StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @sasrsc1966 

     

    1. Person field in Office365 and Sharepoint stores in a different way. Both objects are different.
    2. Default Selected items depend on Items property.
      1. If the items property is Sharepoint then DefaultSelectedItems should be 

        {

            Claims:"i:0#.f|membership|"

      2. If you use Items property as Office365 then DefaultSelectedItems should be Office365Users.SearchUser
    3. SP uses a property called Email but Office365 uses Mail.


    Thanks,
    Stalin - Learn To Illuminate

  • swaisner Profile Picture
    2 on at

    Thank you so much for posting this.  I have had this issue for close to a month and have had a Microsoft case opened.  I was able to update my fields to match yours and it resolved my entire issue.  THANK YOU!!!!!!

  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    @swaisner, Glad it worked for you.


    Thanks, Stalin (Microsoft MVP)
    Blog - Learn To Illuminate Blog
    YouTube - Learn To Illuminate Videos

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 85

#2
WarrenBelz Profile Picture

WarrenBelz 76 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard