cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Andy_Prog
Resolver I
Resolver I

Filtering Employee Directory

Hey guys,

 

I am trying to create a directory, and what I am trying to do is filter with a search bar and a dropdown menu.

The drop down works only when there's a value selected, but I want the first value to be empty but to provide all the information from the Office365Users and be able to view it on the Gallery section.

 

The Gallery functionThe Gallery functionThe items provided in the drop down menuThe items provided in the drop down menu

Hope someone can help me, I have tried as much as possible and I am struggling.

If you could provide some assistance, I'm pretty new at this, I would appreciate it.

 

Thanks,

 

Andy.

2 ACCEPTED SOLUTIONS

Accepted Solutions
yashag2255
Dual Super User II
Dual Super User II

HI @Andy_Prog 

 

Can you please try to modify your expression as:

Filter(Office365Users.SearchUser({SearchTerm:txtInputEmployee.Text}), Account Enabled = true, If(ddDepartment.Selected.Value <> "",Department = ddDepartment.Selected.Value,true))
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

yashag2255
Dual Super User II
Dual Super User II

Hi @Andy_Prog 

 

This is happening because of incorrect Attribute Name, there is an extra space. Please remove it in the expression.

Expression: Filter(Office365Users.SearchUser({SearchTerm:txtInputEmployee.Text}), AccountEnabled = true,
If(ddDepartment.Selected.Value <> "",Department = ddDepartment.Selected.Value,true))

View solution in original post

6 REPLIES 6
yashag2255
Dual Super User II
Dual Super User II

HI @Andy_Prog 

 

Can you please try to modify your expression as:

Filter(Office365Users.SearchUser({SearchTerm:txtInputEmployee.Text}), Account Enabled = true, If(ddDepartment.Selected.Value <> "",Department = ddDepartment.Selected.Value,true))
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

@yashag2255 thanks for your response.

 

I have modified the expression and it gives me more errors and a warning.

The information is not being read, I'm sure I tried If statements and they will not work.

 

Screenshot (21).pngScreenshot (22).png

Screenshot (24).png

 

If you need any more vaid information I will be happy to provide it.

 

Thank you for replying,

 

Andy.

yashag2255
Dual Super User II
Dual Super User II

Hi @Andy_Prog 

 

This is happening because of incorrect Attribute Name, there is an extra space. Please remove it in the expression.

Expression: Filter(Office365Users.SearchUser({SearchTerm:txtInputEmployee.Text}), AccountEnabled = true,
If(ddDepartment.Selected.Value <> "",Department = ddDepartment.Selected.Value,true))

View solution in original post

Thank you for clarifying that @yashag2255 .

 

It's working, I genuinely appreciate it, thank you very much.

 

I just have another query, if I wanted to add another drop down menu for lists with items(values) and I want it empty similar to the last one, do I add another If after the last If?

 

Kind Regards,

 

Andy.

Hi @Andy_Prog 

 

I am guessing you figured it out, but hust in case you need some assistance:

 
You need to add another if statement separated by comma in your filter query. Please use the expression:
Filter(Office365Users.SearchUser({SearchTerm:txtInputEmployee.Text}), Account Enabled = true, If(ddDepartment.Selected.Value <> "",Department = ddDepartment.Selected.Value,true),If(ddDepartment2.Selected.Value <> "",Department2= ddDepartment2.Selected.Value,true))
Hope this Helps!

Everything is working perfectly now, thank you! I appreciate it!

 

Thank you very much for the help @yashag2255Smiley Very Happy

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,097)