Hi ,
I have an app that was developed to save data locally if the internet connection is lost but it isn't working as expected.
I have this collect to send data to SpList1 when Submit button is pressed:
If(Connection.Connected,Collect(SpList1,collection1));
The issue here is collection1 can have the JSON encoded pictures which are quite long, and this collect might take longtime. Now, when this collect is happening, if the device loses internet connection (if the internet connection is lost during collect is happening), I want powerapps to store the data locally on the device. So, I tried
If(!Connection.Connected,SaveData(collection1,"savcollection)
I tried to test this by turning on the airplane mode while the first collect is running, when I do that, my assumption is the next statement will check if there is no internet connection and evaluate to true and then save the data to savcollection.
This isn't happening. when I changed the 2nd command to "If Connection.Connected" then the data is getting saved which makes no sense because I turned on the airplane mode and that means there's no internet connection and my 2nd if statement must run fine.
I tried Errors function and tried to catch the error if the collect fails because the internet connection is lost but Errors is returning blank.
Any idea why this is happening or how to workaround? Thanks in advance.