Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Sharepoint Person column - filter and limit choices that are scrollable?

(0) ShareShare
ReportReport
Posted on by 1,095

I have a sharepoint list with a person column (listing all users in my tenant).

 

1. How can i in Powerapps filter the combobox so that it excludes all users that starts with a specific set of characthers?

I want to filter out some users.... But i am not successfull trying to apply the filter function the the Item property of the combobox.

 

2. How can i limit how many options the user sees when he clicks on the combobox. I dont want the user to be able to scroll through all users, i want the user to only be able to Search in the combobox?

 

 

  • EmmaWatt Profile Picture
    EmmaWatt 90 on at
    Re: Sharepoint Person column - filter and limit choices that are scrollable?

    Hi Kris, @https://community.powerplatform.com/profile/?userid=768E5901-808F-44D7-AF40-E87C6753EB96

    I have a similar issue with the People Column not filtering, but I am not using a picker, I am just filtering on a collection on the People column matching the current user, but users are not seeing their own selection when running the app, I raised a question on this yesterday and as yet no replies https://powerusers.microsoft.com/t5/Building-Power-Apps/Power-Apps-Collection-based-on-SP-list-does-not-show-a-user-in-a/m-p/2490806

    Many thanks

    Emma

  • Verified answer
    v-xida-msft Profile Picture
    v-xida-msft on at
    Re: Sharepoint Person column - filter and limit choices that are scrollable?

    Hi @Oskarkuus ,

    For your first question, do you want to filter the available options within the Person Picker Up ComboBox?

     

    Based on the needs that you mentioned, I afraid that there is no direct solution to achieve your needs. It is an known issue with Person Picker column of SP List in canvas app -- when you apply a Filter formula to the Person Picker ComboBox, the Person Picker ComboBox would not show up any results. So I think the Filter(Choices([@'SP List].PersonColumn), StartsWith(DisplayName, "test")) could not achieve your needs.

     

    As an alternative solution, I think the Office 365 Users connection could achieve your needs. The user @karlagb20 has faced similar needs with you, please check my response within the following thread:

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Dropdown-choices-People-picker-field/m-p/437988

     

    On your side, you consider add a Office 365 Users connection in your app. Then unlock the Person Picker field data card in your Edit form, set the Items property of the Person Picker ComboBox to following:

    Filter(
     Office365Users.SearchUser({searchTerm: PersonPickerComboBox.SearchText, top:999}), 
     !StartsWith(DisplayName, "Type the filter text here") // excluede users start with a specific text
    )

    Note: The top property within the Office365Users.SearchUser() could limit the returned user results, the Maximum value is 999, in other words, you could only return 999 users at most from your org once time.

    Set the Update property of the Person field data card in your Edit form to following:

    { 
     Claims: "i:0#.f|membership|" & Lower(PersonPickerComboBox.Selected.Mail),
     DisplayName: PersonPickerComboBox.Selected.DisplayName,
     Email: PersonPickerComboBox.Selected.Mail,
     Department: "",
     JobTitle: "", 
     Picture: ""
    }

    Set the DefaultSelectedItems property of the Person Picker ComboBox to following:

    LookUp(Office365Users.SearchUser(), Mail = ThisItem.PersonField.Email)

     

    For your second question, if you want to limit the user options within the Person Picker ComboBox, I think the top property within the Office365Users.SearchUser() could achieve your needs.

    If you want the user not to be able to scroll through all users (based on above solution), instead, only be able to Search in the ComboBox, I afraid that there is no way to achieve your needs in PowerApps currently.

     

    Best regards,

  • FlowMohit Profile Picture
    FlowMohit 64 on at
    Re: Sharepoint Person column - filter and limit choices that are scrollable?

    @Oskarkuus - In your app start prop please use this code to filter display name from people picker field - 

    • ForAll('Name Of Your SP List',Collect(colPersonName,PeopleColumnName.DisplayName))
    • Go to combobox and set it's items property to  - Filter(colPersonName,!StartsWith(Value,"whateveryouwanttoexclude"))

    As per my knowledge there are no options available to control the no of results in the cmb box. You can only search within what you can see in the combobox.

     

     

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,666

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,996

Leaderboard