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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Barcode Scanner - Upda...
Power Apps
Unanswered

Barcode Scanner - Update Records

(0) ShareShare
ReportReport
Posted on by 219

Hello,

 

I'm trying to create an Internal Courier App where we can scan the barcodes and keep track of when a parcel has been delivered to the office, where that parcel currently is and when/who signed for it. I've created first part which is allowing someone to scan the barcode on the parcel which then creates a Sharepoint list record. The bit I'm struggling with is updating that record at a later date, what I'm trying to do is allow the user to scan the parcel barcodes when they get handed over from Security to our Facilities department and then updating the status of those records from "Accepted" to "Handover".

 

This is the code I'm using to add the new records (when security first scan the parcel(s), using the OnScan function):

 

Clear(GetBarCodes);
ForAll(
 BarcodeReader1.Barcodes,
 Collect(
 GetBarCodes,
 {
 Barcodes: ThisRecord.Value
 }
 )
);
ForAll(
 Gallery1.AllItems As aCodes,
 Patch(
 Parcels,
 {
 Title: aCodes.Barcodes,
 Barcode: aCodes.Barcodes,
 'Accepted Delivery': Now(),
 'Parcel Status': {Value: "Accepted"},
 'Accepted By': {
 Claims: Concatenate(
 "i:0#.f|membership|",
 User().Email
 ),
 Department: "",
 DisplayName: User().FullName,
 Email: User().Email,
 JobTitle: "",
 Picture: ""
 }
 }
 )
);

 

I now have another screen called "Handover" which a member of the Facilities team will use to scan the same parcels once they have them. The issue I'm struggling with is I'd need to know the ID of the record of each parcel scanned and then apply the update to each of the scanned barcodes by changing the status from "Accepted" to "Handover".  I'm having one of those days where my brain doesn't want to function, any guidance would be much appreciated in how i can achieve what I'm trying to do.

 

If you've any questions, please feel free to ask and I'll try my best to answer them for you. Thank you in advance.

Categories:
I have the same question (0)
  • Verified answer
    JasonZF Profile Picture
    572 on at

    You could do almost the same thing you are now, except with a LookUp() within the second parameter of your Patch() to retrieve the record, which you are currently omitting.

     

     

    ForAll(
     Gallery1.AllItems As aCodes,
     Patch(
     Parcels,
     LookUp(
     Parcels,
     Title = aCodes.Barcodes
     ),
     {
     'Parcel Status': {Value: "Handover"}
     }
     )
    );

     

    When creating new records, you should have this as your second parameter:

     

    Defaults(Parcels)

     

    Also, if there's ever a repeated barcode, I'm not sure if the older or newer record will be retrieved with the lookup. You could probably do this to ensure the records are sorted newest to oldest.

     

    LookUp(
     SortByColumns(
     Parcels,
     "Created",
     SortOrder.Descending
     ),
     Title = aCodes.Barcodes
    )

     

     

  • CCEP_Mike Profile Picture
    219 on at


    @JasonWS thank you so much, i feel so dumb right now! I'm having one of those days, appreciate the support.

  • JasonZF Profile Picture
    572 on at

    You are welcome! We all have those days!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard