Hi,
I'm trying to use the Search using the With as given in this blog https://powerusers.microsoft.com/t5/Power-Apps-Community-Blog/With-Statement-to-include-non-Delegable-filters/ba-p/660997 by @WarrenBelz .
Having some issue since my Filter will change based on User . How to add the If condition to change the Filter
If
(
selectedNavItem = 2,
SortByColumns(
Filter(
SPLIST,
RequesterDepartment=LogInUserDept),
StartsWith(RequestTitle, searchInput.Text) ||
StartsWith(RequesterFullName, searchInput.Text) ||
IsBlank(searchInput.Text)),
"ID", Descending),
selectedNavItem = 3,
SortByColumns(
Filter(
SPLIST,
RequesterEmail=LogInUserMail,
StartsWith(RequestTitle, searchInput.Text)||
IsBlank(searchInput.Text)),
"ID", Descending)
)
I tried adding like below and I know it is not correct.
With(
If(selectedNavItem = 2,
{
MyFilter:
Filter(
SPList,
Department=LogInUserDept),
},
selectedNavItem = 3,
{
MyFilter:
Filter(
SPList,
Email=LogInUserMail),
}
),
Search(
MyFilter,
searchInput.Text,
"FullName",
"Title"
)
)