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 / Barcode Collection - C...
Power Apps
Unanswered

Barcode Collection - Clear to Prepare for Next Record Entry

(0) ShareShare
ReportReport
Posted on by

@RandyHayes 

 

Hello Randy,

 

I am currently working on a Shipping App. The screen below is for the Logistics team only. Overall, scanning barcodes is going pretty well, but I'm having trouble prepping the Collection for the next entry. When I scan barcodes into the Collection, they are automatically added to the Tracking Numbers(s) field in the form. When I click the Send Shipment... button, the barcodes are written to the data source. If I clear the Collection OnSuccess of the Form, not only the Collection is erased, but also the tracking numbers in the form field (they remain in the data source). If I don't clear the Collection, when I click on a different job (e.g. 10002) to enter barcodes, the information from job 10001 not only displays in the Collection, but also the form field despite the fact the Item property of the form is set to varRecord. How can I retain the information in the form, but erase the contents of the Collection so it is ready to go for the next job? All of the formulas for this screen are in the attached Word doc.

 

Thank you in advance for your help, Teresa

 

BarcodeCollectionss.png

Categories:
I have the same question (0)
  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @tagustin2020 ,

     

    Please try and add a variable varScanned into your App, set it as false by default and once scanned set to true. So then the Tracking Numbers Value TextInput should display the default value of varRecord when not scanned and change to the collection result after scanned. Follow below formulas:

     

    1\ Set Default of Tracking Numbers Value Field:

     

    If(varScanned, Concat(colBarcodes,barcode, ", "), Parent.Default)

     

     

    2\ Truck OnSelect:

     

    Set(varRecord, LookUp('Domestic Shipping Requests', ID = ThisItem.ID));
    ClearCollect(colBarcodes, RenameColumns(Split(varRecord.barcode, ","),"Result","barcode"));
    Navigate('Logistics Screen',ScreenTransition.None)

     

     

    3\ Logistics Screen OnVisible

     

    SetFocus(txtBarcode);
    Set(varScanned, false)

     

     

    4\ Barcode Scanning Text Input Control OnChange:

     

    Collect(colBarcodes, {barcode:Self.Text,DateTime:Now()});Reset(Self);SetFocus(Self);
    Set(varScanned, true)

     

     

    5\ Form Control OnSuccess:

    Set(varRecord,frmLogistics.LastSubmit);
    Set(varScanned, false)

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • tagustin2020 Profile Picture
    on at

    @v-jefferni 

    @RandyHayes 

     

    Hello Jeff,

     

    First of all, please accept my apology for not getting back to you sooner. I really appreciate the time and effort you took to offer a solution. I see that someone accepted it as a solution, but when I tried it this morning the Split portion of the OnSelect formula is throwing an error as is the Default formula for the data card value. I was wondering if you or Randy could help me iron out the kink and also explain what this portion of the code is for to help me with my goal of understanding records and formulas. When I click the truck icon, it no longer navigates to the Logistics screen.

     

    Truck Icon OnSelect formula:

     

    SplitErrorSS.png

     

    I tried both copy/pasting your code in the post above and also manually typing it. Can you help me troubleshoot?

     

    Set(varRecord, LookUp('Domestic Shipping Requests', ID = ThisItem.ID));ClearCollect(colBarcodes, RenameColumns(Split(varRecord.barcode, ","), "Result", "barcode"));Navigate('Logistics Screen',ScreenTransition.None)

     

    Barcode Data Card Value Field Default formula:

    If(varScanned, Concat(colBarcodes,barcode, ", "), Parent.Default)

     

    Thank you,

    Teresa

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @tagustin2020 

    I believe in your case, the issue is with that varRecord.barcode  

    Your source does not have that column, it has a Barcodes column.

     

    However, you are going to encounter issues with that column based on two things.  1 it is rich text – it will have html markup in it.  2 it is an append column.  So you will not be seeing prior version text from it. It will only support showing the most recent.

     

    I would advise getting rid of the enhanced text and getting rid of the append text options.

  • tagustin2020 Profile Picture
    on at

    @RandyHayes 

     

    Hi Randy,

     

    Thank you for catching that. As soon as you mentioned the discrepancy, I remembered that I had made some changes to the data source. Everything seems to be working as intended now, but I am getting an error in the Default property of the Tracking Number(s) data card. I tried deleting the data card and re-adding it after 5-10 minutes. Do you think maybe it is still picking up the old column settings or is something else going on? None of the other errors are showing errors. I am attaching a Word doc that shows all of the latest formulas in case it helps in any way.

     

    If(varTracking, Concat(colTracking,TrackingNumber, ", "), Parent.Default)

     

    Error 1:

     

    NameNotValidSS.png

     

    Error 2:

     

    IfInvalidSS.png

     

    Thank you for helping me both Saturday and Sunday. I'm trying to get the app as far along as possible before a Tuesday status update with the team so I really appreciate you helping me, especially over your weekend. I totally understand if you have to step away. Teresa

     

     

     

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 549 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 225 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 224

Last 30 days Overall leaderboard