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 / how to make people pic...
Power Apps
Answered

how to make people picker to show 3 people

(0) ShareShare
ReportReport
Posted on by 313

Hello all thank you for reply my message.
I am trying to make the combo field from people picker to show only 3 default people with IF statement, whereby
if it this user 1 and user 2, i want the field to be blank, Else users  have to select between user 4 and user 5.
i have manage to ser for blank and user 4 in the if statement.
but how do i set for user 5.

If(
 User().Email="user1@email" || User().Email="user2@email" || && Form1.Mode=FormMode.New,
 {
 DisplayName: Blank(),
 Claims: Blank(), 
 Department: Blank(), 
 Email: Blank(), 
 JobTitle: Blank(), 
 Picture: Blank()
 },
 {
 DisplayName: Office365Users.UserProfile("user4@email").DisplayName,
 Claims: "i:0#.f|membership|" & Lower("user4@email"), 
 Department: "", 
 Email: "user4@email", 
 JobTitle: "", 
 Picture: ""
 }
)

 Thank you for your help

Categories:
  • v-yueyun-msft Profile Picture
    Microsoft Employee on at

    HI , @WeiMingLeong 

    You can try to use this code in Combo box - DefaultSelectedItems:

     

    If(
     User().Email="user1@email" || User().Email="user2@email" || && Form1.Mode=FormMode.New,
     Table({
     DisplayName: Blank(),
     Claims: Blank(), 
     Department: Blank(), 
     Email: Blank(), 
     JobTitle: Blank(), 
     Picture: Blank()
     }),
    Table(
     {
     DisplayName: Office365Users.UserProfile("user4@email").DisplayName,
     Claims: "i:0#.f|membership|" & Lower("user4@email"), 
     Department: "", 
     Email: "user4@email", 
     JobTitle: "", 
     Picture: ""
     },{
     DisplayName: Office365Users.UserProfile("user5@email").DisplayName,
     Claims: "i:0#.f|membership|" & Lower("user5@email"), 
     Department: "", 
     Email: "user5@email", 
     JobTitle: "", 
     Picture: ""
     }
    )
    )

     

     

    If this reply can help you , you can click mark this reply as solution, thanks in advance!


    Best Regards,

    Yueyun Zhang

     

  • Wei Ming Leong Profile Picture
    313 on at

    Dear @v-yueyun-msft ,

    it work but i have abit of issue to it.  
    under the 2nd part of the table ,if user is not user 1 or 2 it will automatically select user 4 and user 5 into the combobox. 
    how do i set it not to select any of user4/user5?

     

    thank you

  • v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi, @WeiMingLeong 

    According to your description, you do not want to select the user4 and user5.

    The DefaultSelectedItems property is used to set the default selection in Combo box.

    If you do not want the user to see and select user4 and user5 . You need to filter it in combo box- items,like this;

    If(
     User().Email="user1@email" || User().Email="user2@email" || && Form1.Mode=FormMode.New, Choices(Persons.PersonTest),
    Filter( Choices(Persons.PersonTest) ,Not( Claims in [$"i:0#.f|membership|{Lower("user4@email")}",$"i:0#.f|membership|{Lower("user5@email")}"] ) ) )

     

    If you also want to default select all the people but not include user4 and user5, you can use this code in your combo box DefaultSelectedItems: 

    If(
     User().Email="user1@email" || User().Email="user2@email" || && Form1.Mode=FormMode.New,
     Table({
     DisplayName: Blank(),
     Claims: Blank(), 
     Department: Blank(), 
     Email: Blank(), 
     JobTitle: Blank(), 
     Picture: Blank()
     }),
    Filter( Choices(Persons.PersonTest) ,Not( Claims in [$"i:0#.f|membership|{Lower("user4@email")}",$"i:0#.f|membership|{Lower("user5@email")}"] ) )
    )
    
    

     

    If this reply can help you , you can click mark this reply as solution, thanks in advance!


    Best Regards,

    Yueyun Zhang

     

     

  • Wei Ming Leong Profile Picture
    313 on at

    Dear @v-yueyun-msft ,

    Thank you for your reply.
    for user 1 and user 2 i want the people picker combobox to be blank.
    but for all other user i want the people picker combobox to only show user 4 or user 5.
    base on your earlier table it will automatically put user 4 and user 5 for as default selected. I have false the multiselect and now it automatically select user 4 as default.
    not like a dropdown list whereby the rest of the users can select user4 or user 5.

  • v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi , @WeiMingLeong 

    According to your description, do you mean you want to control the combo box items?

    If the user is user1 and user2, it will be blank and the rest user can just select user4 and user5?

    If this , you can use this code in combo box - items.

    If(
     User().Email="user1@email" || User().Email="user2@email" || && Form1.Mode=FormMode.New, Choices(Persons.PersonTest),
     Table({
     DisplayName: Blank(),
     Claims: Blank(), 
     Department: Blank(), 
     Email: Blank(), 
     JobTitle: Blank(), 
     Picture: Blank()
     }),Table(
     {
     DisplayName: Office365Users.UserProfile("user4@email").DisplayName,
     Claims: "i:0#.f|membership|" & Lower("user4@email"), 
     Department: "", 
     Email: "user4@email", 
     JobTitle: "", 
     Picture: ""
     },{
     DisplayName: Office365Users.UserProfile("user5@email").DisplayName,
     Claims: "i:0#.f|membership|" & Lower("user5@email"), 
     Department: "", 
     Email: "user5@email", 
     JobTitle: "", 
     Picture: ""
     }
    ) )

     The DefaultSelectedItems property is used to set the default selected items in combobox . It can not influence the items show in the combo box .

     

    If I misunderstand what you mean, you can describe your needs and your expected outcomes in detail so that we can better help you. If this reply can help you , you can click mark this reply as solution, thanks in advance!


    Best Regards,

    Yueyun Zhang

     

  • Wei Ming Leong Profile Picture
    313 on at

    Dear @v-yueyun-msft ,

    can i ask for the fomula that you put Choices(Persons.PersonTest)
    is it choice(SharepointList. ColumnName)? 

     

    thank you

  • v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi , @WeiMingLeong 

    Thanks for your quick response!

    Yes, i put the choice(SharepointList. ColumnName) . 

    So what do you put in combo box items property. And what do you want to do in this combo box?


    Best Regards,

    Yueyun Zhang

  • Wei Ming Leong Profile Picture
    313 on at

    Dear  @v-yueyun-msft ,

    my combobox items property is nothing and trying to put your code down.


    what i want this combobox of the person picker from sharepoint list to only put user 4 and user 5.
    meaning that all other user are able to select user 4 or user 5 beside user1 and user2 will be blank.
    my sharepoint list name is Cebu WFH Application List.
    column name is Approver Manager (People Picker column)

    i am trying with your code. but i get error when i put my sharepoint list and column name.

    If(
    User().Email="user1@email" || User().Email="user2@email" && Form1.Mode=FormMode.New, Choices('Cebu WFH Application List'.Approver Manager),
    Table({
    DisplayName: Blank(),
    Claims: Blank(),
    Department: Blank(),
    Email: Blank(),
    JobTitle: Blank(),
    Picture: Blank()
    }),Table(
    {
    DisplayName: Office365Users.UserProfile("user4@email").DisplayName,
    Claims: "i:0#.f|membership|" & Lower("user4@email"),
    Department: "",
    Email: "user4@email",
    JobTitle: "",
    Picture: ""
    },{
    DisplayName: Office365Users.UserProfile("user5@email").DisplayName,
    Claims: "i:0#.f|membership|" & Lower("user5@email"),
    Department: "",
    Email: "user5@email",
    JobTitle: "",
    Picture: ""
    }
    ) )

  • Verified answer
    v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi , @WeiMingLeong 

    Thanks for your response! According to your description, you want the combo box items just show the user4 and user5 beside user1 and user2 will be blank.

    Can you try to use this code in the Combo Box - Items property:

    If(
    User().Email="user1@email" || User().Email="user2@email" && Form1.Mode=FormMode.New,
    Table({
    DisplayName: Blank(),
    Claims: Blank(),
    Department: Blank(),
    Email: Blank(),
    JobTitle: Blank(),
    Picture: Blank()
    }),Table(
    {
    DisplayName: Office365Users.UserProfile("user4@email").DisplayName,
    Claims: "i:0#.f|membership|" & Lower("user4@email"),
    Department: "",
    Email: "user4@email",
    JobTitle: "",
    Picture: ""
    },{
    DisplayName: Office365Users.UserProfile("user5@email").DisplayName,
    Claims: "i:0#.f|membership|" & Lower("user5@email"),
    Department: "",
    Email: "user5@email",
    JobTitle: "",
    Picture: ""
    }
    ) )

     If this , you can do not put the Choices(List.ColumnName) in the code , you can just use the static code to realize it.

     

     

    If I misunderstand what you mean, you can describe your needs and your expected outcomes in detail so that we can better help you. If this reply can help you , you can click mark this reply as solution, thanks in advance!


    Best Regards,

    Yueyun Zhang

  • Wei Ming Leong Profile Picture
    313 on at

    @v-yueyun-msft ,

    thank you for your help it work as what i wanted.

    Thank you Very MUCH!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 234 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 169

Last 30 days Overall leaderboard