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 / How to Filter a combob...
Power Apps
Unanswered

How to Filter a combobox people picker from a different SharePoint list & populate a text label from selections

(0) ShareShare
ReportReport
Posted on by 51

Hello! 

 

I have 2 Sharepoint Lists for my PowerApp: Projects & Users

Projects has fields ID, Assigned To (mult-select people picker)

Users has fields ID, UserRecord (single-select people picker), Specialty

 

Relevant Powerapps elements:

comboAssignedTo (combobox)

labelSpecialty (label)

 

Outcomes:

  • Filter the Projects.'Assigned To' people picker combobox comboAssignedTo choices to ONLY show people that are in the Users.UserRecord list & save the combobox selections to Projects on form submission
  • Populate labelSpecialty text with the Specialty values from the Users list based on selected items in the combobox comboAssignedTo (concatenated for multiple selections)

 

where I'm at:
I have the comboAssignedTo displaying the records i want with this as the items property:

 

 

With(
 {
 _prefiltered_users: Filter(
 Users, ID > 0
 )
 },
 Sort(
 ForAll(
 Ungroup(
 _prefiltered_users,
 UserRecord 
 ),
 UserRecord
 ),
 DisplayName,
 SortOrder.Ascending
 )
)

 

 

but when I try to save the record, I get a patch error (no details, just "Network error when using Patch function: An error occurred on the server.")

**I've tried refreshing the data connection, same error

 

I've got this for the labelSpecialty label text property so far but it errors out:

 

Concat(comboAssignedTo.SelectedItems, Value & ", ")

 

do I need a 'For All' in here somewhere?

 

Thanks in advance!!

Categories:
I have the same question (0)
  • Verified answer
    Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @ImaKickUrAsh - that code looks familiar 😉

     

    1. Assuming your data source is SharePoint, there is no need to use a Filter function to check if a record exists. The reason a Filter was used on my blog was to allow users to optionally Filter the data source first. The below will suffice:

     

     Sort(
     ForAll(
     Ungroup(
     Users,
     UserRecord 
     ),
     UserRecord
     ),
     DisplayName,
     SortOrder.Ascending
     )

     

    2. The Items property of the comboAssignedTo contains a Table of records. If you check my blog again you will see a section where I explain the columns returned in that People data type schema are:

     

    • Claims
    • Department
    • DisplayName
    • Email
    • Job Title
    • Picture

     

    Using "Value" is not going to work here, because that is not a column which exists in that table schema. With this understanding in mind, use:

     

    Concat(comboAssignedTo.SelectedItems,DisplayName & ";")

     

    3. Regarding the error message:

     

    1. Are you using an Edit Form control to save the selected records? (same as my blog?)
    2. Are you certain the "Assigned To" DataCard is the cause for the error? Could you remove all other DataCards and confirm?
    3. Are you certain the "Assigned To" is set to multi-select?

     

    Blog post for reference for anyone else who reads this post:

     

    https://powerusers.microsoft.com/t5/Power-Apps-Community-Blog/Filter-SharePoint-single-or-multi-select-People-Picker-based-on/ba-p/2235959#M1694 

  • ImaKickUrAsh Profile Picture
    51 on at

    Thanks for your response & for your awesome blog post that got me most of the way there 🙂

     

    1. got it, thanks - the combobox is displaying the filtered user list now without checking for ID 🙂

    2. apologies for the lack of clarity: I'm not trying to pull the DisplayName from the selected records in the combobox, I'm trying to get the Specialty field value from the Users table for each of the selected combobox items

    example: 

    Users 

    IDUserSpecialty
    1[User Record 1: DisplayName: John]Development
    2[User Record 2: DisplayName: Sarah]Presentations
    3[User Record 3: DisplayName: Sundeep]Documentation

     

    if combobox has John & Sundeep selected, label text should populate "Development; Documentation"

     

    3.1. Yes on EditForm control

    3.2. i republished with the items property update (no other changes to data cards) & it seems to be working now

    3.3. yes multi-select = true

  • Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @ImaKickUrAsh - my fault I misread your post for item 3. You're correct we can use ForAll here:

     

     

    Concat(
     ForAll(
     comboAssignedTo.SelectedItems As _selections,
     LookUp(
     Users,
     UserRecord.Email = _selections.Email,
     Specialty
     )
     ),
     Value & ";"
    )

     

  • ImaKickUrAsh Profile Picture
    51 on at

    this works perfectly! thank you so much for the guidance!

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard