0
votes

I have below case in my app, am filtering data based on the user logged in with many condition but its take long time to retrieve the data since i have "And / or " in my filter

should i use lookup/search ?

UpdateContext({LoadText:"Loading Data... Please Wait..."});
//Refresh('[dbo].[table2]');

ClearCollect(table1,Filter(ShowColumns('[dbo].[table2]',"ID","Description","Room_Type","ActionBy","Action_user","Area","Room_no","Building","Floor","Topic","SubTopic","Snag_Item","userid","Attachment","Actual_Status","Desc_Const","Desc_QC","Desc_Client","Client_status","Contractor_status","Recheck_Const","Recheck_QC"), Action_user = TextInput1.Text ,
Actual_Status = "" Or Actual_Status ="Yes" && Contractor_status = "No" Or Actual_Status ="Yes" && Contractor_status = "No" && Recheck_Const = "Yes" ));

UpdateContext({LoadText:"Loading Data... Please Wait..."});
1

1 Answers

0
votes

It all depends on your objective:
- Filter finds all records in a table that satisfy a formula.
- LookUp finds the first record in a table that satisfies a formula.
- Search finds records in a table that contain a string in the specified columns.
Each function has its purpose. Long response times can occur because of the size of your data source / data set. More data being processed means more time processing it. From the code you showed us I can see that your table have lots of rows, that may be the reason that your Filter funtion is taking a while to load.
Do you really need no return all that rows? Try to shrink the data you receive as much as possible to improve load times.

Best regards