
Announcements
Hi,
not sure if this is possible, but I would like to filter a Data table from a dropdown control, then once filtered allow a text input field to search, filter the results even more based on the value entered in the text input field.
I have a Data table that is linked to a SharePoint list called: 'CUO Tasks'
I have a drop down box called Dropdown1 and a text input field called SearchInput.
On App (on Start) I have the following collection
ClearCollect(
colViews,
{
ViewName: "Active UW Tasks Pending",
ViewColumns: [
"Title",
"TCMAOpenBoxReference",
"BinderUMR",
"NameOfFacility",
"DUAUnderwriter",
"Inception",
"CUOApprovalStatus",
"SecondApprovalStatus",
"Created",
"PricingLevel"
]
},
{
ViewName: "Active UW Tasks Rejected",
ViewColumns: [
"Title",
"TCMAOpenBoxReference",
"BinderUMR",
"NameOfFacility",
"DUAUnderwriter",
"Inception",
"CUOApprovalStatus",
"SecondApprovalStatus",
"EMApprovalStatus",
"PricingApprovalStatus",
"DUAApprovalStatus",
"LastRejectedUser",
"LastRejectedDt",
]
},
{
ViewName: "All Tasks",
ViewColumns: [
"Title",
"TCMAOpenBoxReference",
"BinderUMR",
"NameOfFacility",
"DUAUnderwriter",
"Inception",
"CUOApprovalStatus",
"SecondApprovalStatus",
"EMApprovalStatus",
"PricingApprovalStatus",
"DUAAprovalStatus",
"UWacceptance"
]
}
)
Then on my DataTable (items) I have:
Switch(
Dropdown1.Selected.ViewName,
"Active UW Tasks Pending",
Filter(
CUOTasks,
CUOApprovalStatus.Value = "Pending"
),
"Active UW Tasks Rejected",
Filter(
CUOTasks,
CUOApprovalStatus.Value = "Rejected" || SecondApprovalStatus.Value = "Rejected" || EMApprovalStatus.Value = "Rejected" || PricingApprovalStatus.Value = "Rejected" || DUAApprovalStatus.Value = "Rejected"
),
"All Tasks",
Search(CUOTasks,SearchInput.Text,"Title","BinderUMR","NameOfFacility","TCMAOpenBoxReference"
),
CUOTasks
)
I also have on the visible control for all fields in the data table to show /hide them based on what has been selected:
Self.FieldDisplayName in Dropdown1.Selected.ViewColumns
and on my Dropdown1 control (Items) I have it set to the variable colViews.
Now when I change the view in my drop down control (Dropdown1) to any of the the first two views (Active UW Tasks Pending and Active UW Tasks Rejected) they filter correctly as I have filters on them. When I select the third view 'All Tasks' it is filtered by the SearchInput control as you can see, I only a search function on it: Search(CUOTasks,SearchInput.Text,"Title","BinderUMR","NameOfFacility","TCMAOpenBoxReference"
What I would like to do now is add the above search function that I have in the 'All Tasks' view to the other two views (along with the filter function they already have so that when I either select Active UW Tasks Pending or Active UW Tasks Rejected from the dropdown it first filters via the filter formula but then can be further filtered by the search function / from values entered into the SearchInput control, like the All Tasks view does.