Hi! I'm currently working on a scan mobile app that is able to work offline. I'm currently using an Excel file in my OneDrive as database during the test phase, later it might use SP list or the same Excel in OneDrive.
The thing is I can't avoid the big red error messages on top of the screen when the app starts. This is the code:
OnStart:
If(Connection.Connected;
ClearCollect(ColDespacho1;Despacho1);;SaveData(ColDespacho1;"ColDespacho1Local");;
ClearCollect(ColDespacho2;Despacho2);;SaveData(ColDespacho2;"ColDespacho2Local");;
ClearCollect(ColDespacho3;Despacho3);;SaveData(ColDespacho3;"ColDespacho3Local")
;
LoadData(ColDespacho1;"ColDespacho1Local"; true );;
LoadData(ColDespacho2;"ColDespacho2Local"; true );;
LoadData(ColDespacho3;"ColDespacho3Local"; true )
)
Then I have one Button that let's the user select wich collection to use, this is the code:
OnSelect:
If(Connection.Connected ; ClearCollect(
DespachoActual;
Switch(
ListaDespachos.Selected.Value;
"Despacho1";
ColDespacho1;
"Despacho2";
ColDespacho2;
"Despacho3";
ColDespacho3
); {DespachoCargado: ListaDespachos.Selected.Value}
);;
SaveData(DespachoActual; "DespachoActualLocal")
;
LoadData(DespachoActual; "DespachoActualLocal";true))
After that there's a gallery and a DataTable only for view that have "DespachoActual" as their origin. There's no other call for the database at all but I keep getting the error message as soon as the app starts. Even when I only had the button and the OnStart property I had the error message. Is like it completly ignores the if statement with the Connection.connected formula and tries to connect to the online files anyway
BTW: in the code the ; are , and ;; is ; for you guys since I'm from Argentina and PowerApps in Spanish works this way for some reason. I can translate the code if it's hard to read.