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 / Filtering a choice fie...
Power Apps
Unanswered

Filtering a choice field in a form

(0) ShareShare
ReportReport
Posted on by 27

Hello,

I have such a situation where every Person is asigned some Legal Entitities. In this case John is assigned Legal entity A and B.

The field 'Same data Entities' is a multiple choice field, containing the names of all possible entities from A - Z.

armiv_0-1700053603136.png

I am showing all this information in a form in Power Apps and I want to show in the combo-box for 'Same data Entities' only the entities relevant to the user, i.e John should only be able to see either A or B.

 

How can I filter  in a choice field, is iteven possible to filter it?

Thank you in advance.

Categories:
  • M_Ali_SZ365 Profile Picture
    1,110 on at

    Hi @armiv ,

    Certainly! To filter the choices in a combo-box based on the user's assigned entities, use the Filter function. Assuming your entities are stored in a data source, like a SharePoint list, and the assigned entities for each person are in a field named AssignedEntities, the formula for the combo-box Items property would be:

    Filter('YourEntityDataSource', "A" in AssignedEntities || "B" in AssignedEntities)

    Replace 'YourEntityDataSource' with the actual name of your data source. This formula filters the choices to show only entities "A" and "B" if they are assigned to the user.

    Fuel our success! 🚀 Give a thumbs up and click 'Solution Accepted' to supercharge our community. Your actions speak volumes!
    Warm regards,
    Muhammad Ali

  • AARON_C Profile Picture
    2,235 Most Valuable Professional on at

    Hi @armiv,

     

    I have created a collection to do this (create the collection anywhere you like, maybe on the OnVisible of the screen your form is on.)

     

     

    ClearCollect(populateComboBox, 
     Filter('Letter of representation', 
     'Person Id Information' = First(Split(User().FullName, " ").Value).Value).'Legal entity 
     information'
    )

     

     

    Then for the Items property of your combo box place in: populateComboBox

     

    Please tick Accept as solution if the answer is useful.

    Thanks,

    @AARON_C 

     

  • armiv Profile Picture
    27 on at

    This would only work for one user and if I know for sure which Legal Entities they are assigned to. It needs to be dynamic since I have areound 400 users.

  • armiv Profile Picture
    27 on at

    Unfortunatelly it is not workinf for me, since after the Filter I cannot assign any other value:

    armiv_0-1700056552700.png

     

  • M_Ali_SZ365 Profile Picture
    1,110 on at

    @armiv ,

    Hi Try this

    Filter('YourUserEntityMappingDataSource', UserField = User().Email).AssignedEntities

    Fuel our success! 🚀 Give a thumbs up and click 'Solution Accepted' to supercharge our community. Your actions speak volumes!
    Warm regards,
    Muhammad Ali

     

  • AARON_C Profile Picture
    2,235 Most Valuable Professional on at

    @armiv 

     

    Are you not filter your combo box by the 'Person Id Information' column which is the First name of the logged in user? and not by the email.

     

    Please copy the code from my first post and place it into the OnSelect property of a button, then click on the button to create the collection. Then for your combo box please change the Items property to be populateComboBox.

  • armiv Profile Picture
    27 on at

    I am filtering per email, I could also filter by the 'Person Id Information', that is not a problem, the issue is that my Filter formula doesn't work in the way you have explained.

    armiv_0-1700057307951.png

    When I am not putting a dot after the Filter formula, it does not show any error:

    armiv_1-1700057340398.png

     

    Am I doing something wrong?

  • armiv Profile Picture
    27 on at

    Unfortunatelly my Filter formula gives an error if I try to put a dot in the end to continue the logic:

    armiv_2-1700057436142.png

     

     

  • AARON_C Profile Picture
    2,235 Most Valuable Professional on at

    @armiv 

     

    Try and put the filter inside of the ClearCollect function.

     

    That is because there are no other parameters that it is expecting. As you are just using filter it is only expecting the data source and the filtering logic.

     

    Whereas the code I provided is expecting more parameters because I also used the First and Split functions inside the filter function.

  • armiv Profile Picture
    27 on at

    I think I did all you explained. I created a button and put the code you shared with me on OnSelect:

    armiv_0-1700058609999.png

    But still, as soon as I try to put a dot after Filter it goes on error. Without the dot it doesn't show errors.

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 283

#3
Mohsin Ali Profile Picture

Mohsin Ali 221

Last 30 days Overall leaderboard