cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Km00
Helper III
Helper III

Multi-search, filter and text search

Hello!

 

I have the following search setup, it uses 2 dropdowns and 1 text field.

 

It works great EXCEPT for when the 'view' dropdown is changed to "My Documents".

The "My Documents" would show any documents that have user().FullName in the following:  DO_Designee_DisplayName or Doc_Owner_Displayname.

 

Then there is also a view called "All Documents" which just shows all documents in the library.

 

This is what i have so far, the dropdown for Search By and the text in "document item" works great.  It is just the 'View' dropdown that i'm having trouble with.

 

Here is the Items in the gallery and the screenshot of the Search bar.

 

With({
wDoc1: cbDocSearch_1.Selected.Value,
wSearch1: SearchDocTitle_1.Text,
wView1: cbDocView_1.Selected.Value
},
Sort(
Filter(
Filter('Published SMC Document Library',
wView1="All Documents" || User().FullName in DO_Designee_DisplayName || User().FullName in Doc_Owner_DisplayName || cbDocView_1.Selected.Value="All Documents"),
(IsBlank(wSearch1) || IsBlank(wDoc1) ||
Switch(
wDoc1,
"Document Title",
wSearch1 in Doc_Title,
"Document Owner",
wSearch1 in Doc_Owner_DisplayName,
"Document Owner Designee",
wSearch1 in DO_Designee_DisplayName,
"Document Owner's Team",
wSearch1 in SO_Dept_DisplayName
)
)
),
Doc_Title,
Ascending))

 

 

Km00_0-1614613440073.png

 

Km00_1-1614613478622.png

 

Km00_2-1614613511456.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-jefferni
Community Support
Community Support

Hi @Km00 ,

 

Would you like to filter the library by 2 dropdown selected items and text in search text input bar? Which column types are the two columns “DO_Designee_DisplayName” and “Doc_Owner_Displayname”, Text or Person?

 

Since you are working with SharePoint library as data source, then I would assume that the two columns I mentioned above are both Person type columns.

1\ Set a variable OnVisible of the Screen to avoid delegation issue:

Set(varName, User().DisplayName)

 

2\ Modify your formula to:

With({
wDoc1: cbDocSearch_1.Selected.Value,
wSearch1: SearchDocTitle_1.Text,
wView1: cbDocView_1.Selected.Value
},
Sort(
Filter(
Filter('Published SMC Document Library',
wView1="All Documents" || varName in DO_Designee_DisplayName.DisplayName || varName in Doc_Owner_DisplayName.DisplayName),
(IsBlank(wSearch1) || IsBlank(wDoc1) ||
Switch(
wDoc1,
"Document Title",
wSearch1 in Doc_Title,
"Document Owner",
wSearch1 in Doc_Owner_DisplayName.DisplayName,
"Document Owner Designee",
wSearch1 in DO_Designee_DisplayName.DisplayName,
"Document Owner's Team",
wSearch1 in SO_Dept_DisplayName
)
)
),
Doc_Title,
Ascending))

 

If the two columns are not Person type column, please share more details about all columns of the library along with their column types.

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

1 REPLY 1
v-jefferni
Community Support
Community Support

Hi @Km00 ,

 

Would you like to filter the library by 2 dropdown selected items and text in search text input bar? Which column types are the two columns “DO_Designee_DisplayName” and “Doc_Owner_Displayname”, Text or Person?

 

Since you are working with SharePoint library as data source, then I would assume that the two columns I mentioned above are both Person type columns.

1\ Set a variable OnVisible of the Screen to avoid delegation issue:

Set(varName, User().DisplayName)

 

2\ Modify your formula to:

With({
wDoc1: cbDocSearch_1.Selected.Value,
wSearch1: SearchDocTitle_1.Text,
wView1: cbDocView_1.Selected.Value
},
Sort(
Filter(
Filter('Published SMC Document Library',
wView1="All Documents" || varName in DO_Designee_DisplayName.DisplayName || varName in Doc_Owner_DisplayName.DisplayName),
(IsBlank(wSearch1) || IsBlank(wDoc1) ||
Switch(
wDoc1,
"Document Title",
wSearch1 in Doc_Title,
"Document Owner",
wSearch1 in Doc_Owner_DisplayName.DisplayName,
"Document Owner Designee",
wSearch1 in DO_Designee_DisplayName.DisplayName,
"Document Owner's Team",
wSearch1 in SO_Dept_DisplayName
)
)
),
Doc_Title,
Ascending))

 

If the two columns are not Person type column, please share more details about all columns of the library along with their column types.

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (3,279)