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))
Solved! Go to Solution.
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.
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.
Power Apps User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.
Did you miss the call?? Check out the Power Apps Community Call here!
User | Count |
---|---|
255 | |
205 | |
76 | |
37 | |
31 |
User | Count |
---|---|
336 | |
214 | |
119 | |
71 | |
55 |