0

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..."});
osama
  • 5
  • 4

1 Answers1

0

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

  • yes i need all these rows since am using showcolumns for specifics ones only, shrink the data you mean on sql side ? also am calling pictures in my query that am already downsized them to the min kb @Bruno Ferreira – osama Dec 10 '19 at 05:16
  • No, i meant retrieve as few columns as possible, but as you said you already done that. I'm afraid that there's not much more you can do, powerapps takes his time to load data from other sources. – Bruno Ferreira Dec 10 '19 at 09:40