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 Apps
Answered

Combo box value

(0) ShareShare
ReportReport
Posted on by 82

Dear experts, I've created an invoicing app where users create invoices. I use department Combobox to filter my gallery some of the users have to see all the departments and other users have to see only one department in the dropdown,

I have another list linked to my app, this list for access levels containing the UserName column which is the user email and another column for the department, I am using this list to hide buttons based on the current user by user varUseremail on start and it works fine I want to use the same list to filter the gallery based on the Combobox

For example, if Mark@***.com his department Marketing he can only see the Marketing in Combobox item
And if Mark@***. com his Departmen Marketing and Sales he can see both Marketing and sales  in Combobox items

 

I hope I am clear

Thanks a lot 

Categories:
I have the same question (0)
  • Akser Profile Picture
    1,546 Moderator on at

    Hi @mohamednasr,

     

    OnStart (Store the current user's department in a collection)

    //MyUserList is a SharePoint list with 2 columns: UserEmail and Department
    
    ClearCollect(colCurrentUser, MyUserList, UserEmail = User().Email)

    Items property of my combo box (Show departments based on previous collection)

    //MyDepartmentList is a SharePoint list consisting of 1 colum: DepartmentName
    
    Filter(MyDepartmentList, DepartmentName exactin colCurrentUser.Department)

     

  • mohamednasr Profile Picture
    82 on at

    @Akser 

     

    Thanks a lot for your reply but it doesn't work i did it as you recommended "OnStart" the ClearCollect(colCurrentUser, UserListName, UserEmail but it doesn't recognize the column name which is UserEmail 

  • Akser Profile Picture
    1,546 Moderator on at

    @mohamednasr, seems like I forgot to include the Filter function. But either way, this was just an example, you should modify them according to your data source (MyUserList, UserEmail etc.)

     

    ClearCollect(colCurrentUser, Filter(MyUserList, UserEmail = User().Email))

     

  • mohamednasr Profile Picture
    82 on at

    @Akser 

    You are the best, thanks a lot it's working now after I added the filter in Onstart.

    but it gives me a delegation warning in "exactin"

     

    Thanks again

     

  • mohamednasr Profile Picture
    82 on at

    @Akser 

    Also, there is an issue that Combobox duplicating the department name when there is more than one user in same the department

    Example :
    Danial@XX.com in Marketing Department &
    Mark@xx.com in Marketing Department as well in that case the combo box appear with 2 marketing

  • Verified answer
    Akser Profile Picture
    1,546 Moderator on at

    @mohamednasr,

     

    exactin is not Delegable correct. You can try to add the list of departments to a local collection OnStart as well.

    ClearCollect(colDepartment, SortByColumn(Distinct(MyUserList, Department), Result))

    The above formula will create a local collection that contains unique departments (that exist in your user list) - sorted ascending. The only thing left to do is to update the combo box's Items property to refer to this new collection.

    Filter(colDepartment, Result exactin colCurrentUser.Department)
  • mohamednasr Profile Picture
    82 on at

    @Akser 

    Thanks a lot i've tried it and it works fine, i really appreciate you help. Any idea how to show all departments, if the logged user from the management department?

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 136 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 109 Super User 2026 Season 2

Last 30 days Overall leaderboard