cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Andy_Prog
Level: Powered On

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.

 

Screenshot (15).pngThe Gallery functionScreenshot (17).pngThe 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
Super User
Super User

Re: Filtering Employee Directory

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!
Super User
Super User

Re: Filtering Employee Directory

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))
6 REPLIES 6
Super User
Super User

Re: Filtering Employee Directory

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!
Andy_Prog
Level: Powered On

Re: Filtering Employee Directory

@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.

Super User
Super User

Re: Filtering Employee Directory

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))
Andy_Prog
Level: Powered On

Re: Filtering Employee Directory

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.

Super User
Super User

Re: Filtering Employee Directory

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!
Andy_Prog
Level: Powered On

Re: Filtering Employee Directory

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

 

Thank you very much for the help @yashag2255Smiley Very Happy