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 / Bad internet connectio...
Power Apps
Unanswered

Bad internet connection: Ability to wait until scan data is populated, before moving to new scan

(1) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi, 

 

I have developed a inventory scanning tool.

One of the users had bad internet connection, and the app kept scanning. 

He scanned Product A, Product B, Product C, and when looking at the scanned data, it populated Product C as 3 QTY and 0 QTY for both Product A, and Product B. 

I think this is because the data is constantly being overwritten because the App is able to scan, but the data is not being stored. 

During this, the gallery with the scanned data has the loading sign (3 dots) and not populating the data after each scan. 

 

Is there a way for the Scan button to be grey'd out (unclickable) until the previous scanned item is populated? 

 

Or the ability to use connection.connected or connection.metered to somehow fix this. 

 

Also, they're unable to move the inventory as it's in a hospital site, and they are in a basement with bad reception. 

 

Categories:
  • Joel CustomerEffective Profile Picture
    3,224 on at

    use Save Data to work offline if there is a bad internet connection https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/offline-apps

  • eka24 Profile Picture
    20,925 on at

    I think on preventing double submission or waiting until full submission, you need a Pop up . The Pop will be seen until fully submitted.

    https://youtu.be/SaDEVOgOlYY

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • TiagoFreire Profile Picture
    313 on at

    Bad connection throws a wrench in many things. 

     

    Beyond the scope of PowerApps, You mentioned a hospital site. Things can only go so well as there is connectivity, so it it is a point to be talked to the decision makers to add a hotspot there. But back to PowerApps...

     

    You can add a single variable to act as a "semaphore" and ensure that only one request can be sent at a time.

    Set(scanning. true) at the beginning of the button OnSelect.

    Set(scanning, false) at the end.

    Set the button to Visible = Not(scanning).

    It may impact performance, as each scan will have to be done serially, after the other ends, but is very simple to implement as a first step. 

    If the performance hit is unacceptable, using SaveData() and LoadData() (only work on mobile devices, not PC or Mac) can store the scan data  in storage, and load it to a collection, so you can use it without internet.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @jlindstrom 

     

    The scan is matched against a SQL database to validate that the item that was scanned is a product, so there is no way to have this as an offline mode.  (We have over 200,000 items)  

     

    I have SaveData implemented so it saved the count after each scan. It's a great feature as when the app crashes, I can load it back up. But if the wrong info is populated and saved, it does not add value. 

  • TiagoFreire Profile Picture
    313 on at

    If you have unreliable connection, you can scan several items first and store them in a "Items to be checked" collection, and wait to check them against the database after connection is restored. 

     

  • Joel CustomerEffective Profile Picture
    3,224 on at

    How often does the item list change? You can store data in the app using the load from excel option

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @TiagoFreire 

     

    Right, it'll be a long conversation about buying 200+ external wifi hotspots. 

     

    So with your solution with true and false, it will initially show the button (clickable). Then once the button is clicked, it will be set to true (button is unclickable) while it loads the data and once it finishes populating the data, it sets to false and the scan button is clickable again. I'd imagine that I would use " ; " to connect the functions. 

     

    I'll give this a try and see if it works. 

     

     

    The saving to a collection to be verified is a smart solution as well.

    I'd have to change a lot of things as there are dropdowns prior to scanning that are based on a OneDrive file (currently need internet for this). I did this because the Excel Files on OneDrive can be updated without going on the PowerApps editing page so other users can modify this data. Do you know if there is another way to create a dropdown with the datasource that can be accessed on offline mode as well? ( I know that I can create it by using Item: ["Item A", "Item B" etc] but this can be lots of data if I have 200 items).  

    But I do like your idea. With your method I can say something like, If there is no connection, then save the scan to a offline collection to be verified later. 

    Do you know if there is a limitation in data size for storing to a collection in offline mode?

     

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @jlindstrom 

     

    There would be items added once a quarter. 

    Do you mean to upload the Excel as a Static Data source? 

    I thought that there was a limitation in size of the file for that. 

    The file size is 7.25 MB. 

  • Joel CustomerEffective Profile Picture
    3,224 on at

    Only thing I can find indicates there is a 10000 row limit so not a good fit

  • TiagoFreire Profile Picture
    313 on at

    Once you have the data in Excel as a Table, you can use said table as a datasource. 

     

    You can load that table to a Collection, and like all collections, use SaveData() and LoadData() to preserve its contents for offline use. On iffy connectivity, loading every bit of data in collections and preserving them with SaveData() is important to maintain the app state if powerapps is closed and re-opened, as LoadData() will be the only source of information available when the app starts.

     

    Then re-target the selectors to use the Collection instead of reading from the file directly. It is good for performance to have frequently used data  in Collections rather than pointing to data sources, especially if they do not change often. 

     

    You can  design the app to just load the saved data by default, and have a button to 'refresh system data' that updates data from the table on OneDrive or SharePoint manually with one click, to be used when there is connectivity. 

     

    It might even speed the app loading time, as you will not have do connect to OneDrive/SharePoint at startup. 

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 190 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard