web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / If !Connection.connect...
Power Apps
Unanswered

If !Connection.connected evaluating to false when in airplane mode

(0) ShareShare
ReportReport
Posted on by 39

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.

Categories:
I have the same question (0)
  • BCLS776 Profile Picture
    8,994 Moderator on at

    A couple of things to check first:

    1. Some mobile devices leave the wifi & Bluetooth signals on in airplane mode. Please make sure your device is completely disconnected from any network while testing. If you do this while the app is running, it typically shows a message indicating the connection has been lost.
    2. Your statement was missing a bracket, which may cause an issue:
    If(!Connection.Connected,SaveData(collection1,"savcollection))

     

    The Power Apps offline capabilities are very simplistic at this time and you are probably aware they only work on mobile devices and not through a web browser. Ensure you have lots of exception/error handling in your code so you don't accidentally lose data. For example, it's better to Collect(), save every time, then delete only when you verify the Collect() was successful than to hope the Collect() completed all good on its own.

     

    If you find !Connection.Connected is still evaluating incorrectly despite double-checking the device's settings, consider launching a support ticket.

     

    Hope that helps,

    Bryan


  • testtest123test Profile Picture
    39 on at

    Thanks for the reply @BCLS776 . The missing parenthesis was just a typo. I am sure all signals are turning off when I turn on airplane mode. I would expect to see an error too when the collect was trying to collect into SP but the internet connection was lost, but for some reason I don't see any error and as I said no error is captured in the Errors table too.

     

    I like your suggestion on adding lots of exception/ error handling and deleting the data only after verifying data loaded successfully. I will change my code to do that.

     

    Thank You.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 414

#2
Valantis Profile Picture

Valantis 387

#3
timl Profile Picture

timl 344 Super User 2026 Season 1

Last 30 days Overall leaderboard