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

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.

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.

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (58,117)