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 / Can't restrict values ...
Power Apps
Answered

Can't restrict values in Combo Box for SharePoint Person column

(0) ShareShare
ReportReport
Posted on by 107

I have a Person column called "Assigned To" in a SharePoint list. It allows multiple values.

 

In my PowerApp I want to show the possible users that the item could be assigned to. However, instead of showing individual users it shows various groups. No individuals are initially present in the combo box list.

firefox_VIRkShdth6.png

However, once I start typing in the name of a user, it appears. I believe this glitch

 

I have tried two approaches.

 

Approach 1 - filter the combo box items to show only users, no groups

I applied a filter using something like:

 

Filter(Choices([@SPTable].'Assigned To'),StartsWith(Claims, "i:0#.f|membership|"))

 

This did not work as it appears no individual users are loaded until the user starts to enter text to search.

 

Approach 2 - fill the combo box with a list from the O365 Groups connector

 

Office365Groups.ListGroupMembers(First(Filter(Office365Groups.ListOwnedGroupsV3().value,mail="***O365 Group email***")).id).value

 

This shows the right items in the combo box - but I cannot then show the current value of the column. Setting DefaultSelectedItems to ThisItem.'Assigned To' does not do anything.

 

I tried adding a "Claims" column to the table that the O365 Groups connector returned, but this did not make any difference.

 

Can anyone please suggest a way to get this working? Thanks.

Categories:
I have the same question (0)
  • Verified answer
    v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @Spinner ,

     

    I did a test for you.

    vxiaochenmsft_4-1633572733892.png

     

    vxiaochenmsft_0-1633571661774.png

    Insert a combo box control and set its Items property to:

     

    AddColumns(RenameColumns(ShowColumns(Office365Users.SearchUserV2({top:500}).value,"DisplayName","Mail","Department","JobTitle"),"Mail","Email"),"Claims","i:0#.f|membership|"&ThisRecord.Email,"Picture","")

     

     

    Set its DefaultSelectedItems property to:

     

    ThisItem.Test_Person

     

     

    vxiaochenmsft_1-1633572559496.png

    vxiaochenmsft_2-1633572576786.png

    vxiaochenmsft_3-1633572651386.png

     

    Best Regards,

    Wearsky

  • Spinner Profile Picture
    107 on at

    @v-xiaochen-msftThanks Wearsky. That's a big step forward. Since that code shows all users, and I needed only the subset in a particular group, I combined it with my code to produce this:

     

    AddColumns(
     RenameColumns(
     ShowColumns(
     Office365Groups.ListGroupMembers(
     First(
     Filter(
     Office365Groups.ListOwnedGroupsV3().value,
     mail = "***O365GroupEmail***"
     )
     ).id
     ).value,
     "displayName",
     "mail",
     "jobTitle"
     ),
     "mail",
     "Email",
     "displayName",
     "DisplayName",
     "jobTitle",
     "JobTitle"
     ),
     "Claims",
     "i:0#.f|membership|" & ThisRecord.Email,
     "Picture",
     "",
     "Department",
     ""
    )

    This appears to work.

     

    For my benefit, where was I going wrong? Was it my failing to add extra columns (e.g. Department) - are some columns other than Claims, DisplayName and Email required? I note that I also should have been using ThisRecord, which makes sense.

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

    Hi @Spinner ,

     

    The formula looks great.

    According to my test, the Claims and Email columns seem to be required. (I'm sure the Claims column is required.)

    Some other columns such as department, picture... are not necessary.

     

    Best Regards,

    Wearsky

  • Spinner Profile Picture
    107 on at

    @v-xiaochen-msft  In view of that, for performance I've stripped it down to the following, which seems to work fine:

    AddColumns(
     RenameColumns(
     ShowColumns(
     Office365Groups.ListGroupMembers(
     First(
     Filter(
     Office365Groups.ListOwnedGroupsV3().value,
     mail = "***Office 365 Group email***"
     )
     ).id
     ).value,
     "displayName",
     "mail"
     ),
     "mail",
     "Email",
     "displayName",
     "DisplayName"
     ),
     "Claims",
     "i:0#.f|membership|" & ThisRecord.Email
    )

     Thanks for your help!

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
WarrenBelz Profile Picture

WarrenBelz 93 Most Valuable Professional

#2
Haque Profile Picture

Haque 81

#3
Valantis Profile Picture

Valantis 49

Last 30 days Overall leaderboard