I have a gallery that is linked to a SharePoint List. I want to be able to search 3 fields with the 3 search boxes. Now I made 3 search boxes for ID, Name, and Last Name. I can get it working when searching for 1 field but when I try to modify it to search across multiple fields, it breaks.
Filter(tbl_mas_employee,StartsWith(Title,txtEmpCode.Text))
What modifications need to be made to the above function to be able to use the 3 search boxes? Picture
Try this:
Filter(SHAREPOINT_LIST,
Or(
StartsWith(spColumnName1, txtBox1.Text),
StartsWith(spColumnName2, txtBox2.Text),
StartsWith(spColumnName3, txtBox3.Text)
)
)
Consider doing this differently for performance and delegation reasons.
OnVisible
of the screen, create a collection from the Sharepoint List
ClearCreate(colRecords,
Filter(SHAREPOINT_LIST,
condition = someValue
)
)
Have 1 textbox for searching (txtSearch
)
HintText
property to something like Search by Title, column2, etc.
DelayOutput
property to true
Set the gallery Items
property to:
Filter(colRecords,
Or(
txtSearch.Text in Title,
txtSearch.Text in column2,
etc...
)
)
Then its really easy to add another column. Also the user experience is quite nice.