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 filtering and...
Power Apps
Answered

combobox filtering and default values

(0) ShareShare
ReportReport
Posted on by 304

Hi,

 

I have a formula with multiple comboboxes. The items of these comboboxes come from a sharepoint list and are filtered by status value and users that are connected to that items.

Current code in items property is for example:

Distinct(
 Filter(
 Computers;
 Status.Value = "Handed out";
 User.Email = UserField.Selected.Email
 );
 'Asset ID'
)

 

And the default selected items property is set to the following, to make sure that there are only items selected if a user is selected in a people picker:

If(
 !IsBlank(UserField.SelectedItems);
 Distinct(
 Filter(
 Computers;
 Status.Value = "Handed out";
 User.Email = UserField.Selected.Email
 );
 'Asset ID'
 )
)

 

Now I have the problem that whenever there are items in that list that have the status "handed out" but the people column is empty, it selects these items by default. But I want it to only show items that have a value in the people column and have the status "handed out". 

Can somebody help me how to achieve that?

 

And I have a question about the people picker, too. How can I filter the users to show only users from a specific department (in this case the IT department)? Items property is set to this:

Choices([@'Worklist - Give back Devices'].'Signed by')

 

Thank you in advance for helping!

Categories:
  • anandm08 Profile Picture
    1,936 Super User 2024 Season 2 on at

    hi @LisKr ,

    ComboBox Items Property:

    Distinct(
     Filter(
     Computers,
     Status.Value = "Handed out",
     !IsBlank(User.Email),
     User.Email = UserField.Selected.Email
     ),
     'Asset ID'
    )

     

    ComboBox Default Selected Items Property:

    If(
     !IsBlank(UserField.SelectedItems),
     Distinct(
     Filter(
     Computers,
     Status.Value = "Handed out",
     !IsBlank(User.Email),
     User.Email = UserField.Selected.Email
     ),
     'Asset ID'
     )
    )

     

    People Picker Items Property:

    Filter(
     Choices([@'Worklist - Give back Devices'].'Signed by'),
     Department = "IT"
    )

     


    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.

  • LisKr Profile Picture
    304 on at

    @anandm08 

    Thank you for replying! 

    For the comboboxes, I get a delegation warning because of the not operator. Can I ignore it, since the lists shouldn't grow that large (a few hundred elements)?

     

    And the people picker field doesn't show me any users at all. I tried it with other departments and for some I also got no results and for some I only got one despite more people working in that department. Is there another setting or property I need to change so that all people from the department are showing?

  • Verified answer
    anandm08 Profile Picture
    1,936 Super User 2024 Season 2 on at

    Updated ComboBox Items Property without Not Operator

     

    Distinct(
     Filter(
     Computers,
     Status.Value = "Handed out" && 
     Len(User.Email) > 0 && 
     User.Email = UserField.Selected.Email
     ),
     'Asset ID'
    )

     

     

    Updated Default Selected Items Property without Not Operator:

     

    If(
     !IsBlank(UserField.SelectedItems),
     Distinct(
     Filter(
     Computers,
     Status.Value = "Handed out" &&
     Len(User.Email) > 0 &&
     User.Email = UserField.Selected.Email
     ),
     'Asset ID'
     )
    )

     

     

     

  • LisKr Profile Picture
    304 on at

    I still get delegation warning for "Len(User.Email)" and "&&". What else can I try?

     

    And the filter for the people picker doesn't work for me. Either I get nothing back or every user, no matter which department they're in or only two users that start with A, but are also in other departments. That also happens if I try to filter for other departments, so it's not IT-specific.

    I also tried this:

    Filter(
     Choices([@'Worklist - Give back Devices'].'Signed by');
     StartsWith(Department;Trim("IT"))
    )

    That works pefectly fine in another app I built, but in this one it just doesn't return anything.

  • LisKr Profile Picture
    304 on at

    So I completely changed the items property of the combobox. Now it works. Don't know what the issue was.

     

    For the delegation warning, I guess I'll just accept it for now, since the list shouldn't get more than 500 entries. If there should be more in future, I'll need to think of something else.

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 397 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 354

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard