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 Pages / Barcode reader - autom...
Power Pages
Suggested Answer

Barcode reader - automatically scan

(0) ShareShare
ReportReport
Posted on by

Hi everyone,

I'm working with the Barcode Reader control in a Canvas App using the "Automatically Scan" feature. Sometimes, the scanner registers the same QR code twice, in some cases, the app crashes, forcing the user out.

We've set the Scan Quality (qcan) to "High" because lowering it seems to increase the frequency of crashes. However, we are unsure if this setting is directly related to the issue.

Is there a way to reduce app crashes? Also, is it possible to set a limit of one scan per QR code to avoid unintended duplicates?

Any insights or best practices would be greatly appreciated!

Thanks in advance!

Categories:
I have the same question (0)
  • Suggested answer
    Jon Unzueta Profile Picture
    1,834 Super User 2026 Season 1 on at
     
    You're encountering a common issue with the Barcode Reader control in Power Apps, especially when using the "Automatically Scan" mode. Here's a breakdown of the problem and some practical solutions:

    🔍 Problem Summary
    • Duplicate scans: The scanner sometimes registers the same QR code more than once.
    • App crashes: Especially when scan quality is set to lower levels.
    • Scan Quality (qcan): Setting it to "High" improves stability but doesn't eliminate the issue.

    Recommendations & Best Practices
    1. Debounce the Scan Event
    Use a variable to temporarily disable scanning after a successful scan:

    // OnScan property of the Barcode Reader

    If(

       !varScanInProgress,

       Set(varScanInProgress, true);

       Collect(ScannedCodes, BarcodeReader1.Value);

       // Optional: Add logic to check for duplicates

       Set(varScanInProgress, false)

    )

    Or introduce a timer to delay reactivation of the scanner.
    2. Prevent Duplicate Scans
    Before adding a scanned value to your collection, check if it already exists:

    If(

       !IsBlank(BarcodeReader1.Value) &&

       !IsMatch(BarcodeReader1.Value, Concat(ScannedCodes, Value & "|")),

       Collect(ScannedCodes, {Value: BarcodeReader1.Value})

    )

    3. Use “Select to Scan” Mode Instead
    If stability is more important than speed, switch from Automatically Scan to Select to Scan mode. This gives users more control and reduces the chance of duplicate triggers.
    4. Test Across Devices
    Some crashes may be device-specific. If possible, test on different models and OS versions to isolate the issue.
    5. Log and Monitor Crashes
    Use Power Apps Monitor or Azure Application Insights to track when and why crashes occur.

    ⚠️ Known Limitations
    • The Automatically Scan mode is more prone to rapid re-triggers.
    • The Scan Quality setting affects performance and stability but doesn't control scan frequency.
     
    🏷️ Tag me if you have any further questions or if the issue persists.
    ✅ Click "Accept as Solution" if my post helped resolve your issue—it helps others facing similar problems.
    ❤️ Give it a Like if you found the approach useful in any way.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Pages

#1
DP_Prabh Profile Picture

DP_Prabh 41

#2
oliver.rodrigues Profile Picture

oliver.rodrigues 35 Most Valuable Professional

#3
rezarizvii Profile Picture

rezarizvii 28

Last 30 days Overall leaderboard