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 / Why am I getting dupli...
Power Apps
Unanswered

Why am I getting duplicate values?

(0) ShareShare
ReportReport
Posted on by 64

I have a canvas app linked to a Sharepoint list. 

 

On a screen called scanner, the person hits the BarcodeScaner2 button where the onscan property is this: 

If(Len(BarcodeScanner2.Value)=13,
Collect(multiScanCollect, {BarcodeValue: BarcodeScanner2.Value, BarcodeType: BarcodeScanner2.Type, Addedby: User().FullName, StartProductionTime: Text(Now(),"mm/dd/yyyy hh:mm:ss"),EndProductionTime: "0",ToteType: LookUp('Types',Title= Left(BarcodeScanner2.Value,2),Name),Hazard:"0",BuildDuration:"0"});

Set(TimerGo,true);
Navigate('Complete')

,Set(DisplayScanError,true))

The intent is they start a new scan and a timer starts. When the person hits finish, they scan the barcode again as confirmation. They are then returned to the barcodescanner screen. It displays the start time of the scan, end time, item type scanned, and barcode value. 

 

The issue I'm having is that sometimes the screen doesn't switch and won't allow the person to hit finish. When they try again, there are now duplicate values. So my questions are: 1.) How do I prevent duplicate values and 2) Why can't they navigate to the finish screen?

 

Thanks. 

Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,707 Super User 2026 Season 1 on at

    Hi @pgd ,

     

    Since you are using Collect, every time this code is triggered, a new entry is generated in the collection, hence the duplicates. Perhaps the use of ClearCollect will help you, but this will overwrite the entire collection every time the code is executed. Not sure if that poses an issue for you.

     

    Unfortunately I don't see any obvious reason why the user wouldn't navigate to the 'Complete' screen.

  • pgd Profile Picture
    64 on at

    Thanks. So if I use ClearCollect, it will delete everything in the sharepoint list?

  • BCBuizer Profile Picture
    22,707 Super User 2026 Season 1 on at

    Hi @pgd ,

     

    No, the sharepoint list is untouched, just the 'multiScanCollect' collection is overwritten

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!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 936

#2
Valantis Profile Picture

Valantis 604

#3
11manish Profile Picture

11manish 518

Last 30 days Overall leaderboard