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 / Scan barcode and patch...
Power Apps
Answered

Scan barcode and patch data in sharepoint list

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi All,

 

Capture.JPG

 

I try to develop app to record production output.

 

example, Operator choose their name, product, process -- & scan barcode of order. for the first scan it will collect the initial record of operator name, product, process and start time. 1 st time scan of the order denotes order started, 2nd time of same order denotes order finish.

i used this formula for scan & save data

 

Patch(
 'Aluminium Output',
 Defaults('Aluminium Output'),
 {
 Orderno:BarcodeScanner1.Value,
 Start:Now(),
 Product:Product.SelectedText.Value,
 Process:Process.SelectedText.Value,
 Operator:Operator.SelectedText.Value
 }
 )

and the value get saved in sharepoint list,

 

Capture1.JPG

 

for the second time scan of the same barcode it denotes the order completed and lookup the order no & save the finish time.

 

i am struck here, what formula to use, when same order no scanned for 2nd time will lookup the value on sharepoint list and patch the finish time.

 

(1st time scanned it create new record in sharepoint list, 2nd time scan of same order it patch finish time for that order no)

 

any help is highly appreciated.

Categories:
  • Verified answer
    CarlosFigueira Profile Picture
    Microsoft Employee on at

    You can use an expression like the one below to accomplish that. The idea is to first check your SharePoint list to see if the record with that order number exists. If it doesn't (first scan), you will create a new item. If it does (second scan), you will update it, setting the finish time.

    Set(
     ExistingOrder,
     LookUp('Aluminium Output', Orderno = BarcodeScanner1.Value));
    If(
     IsBlank(ExistingOrder),
     Patch(
     'Aluminium Output',
     Defaults('Aluminium Output'),
     {
     Orderno:BarcodeScanner1.Value,
     Start:Now(),
     Product:Product.SelectedText.Value,
     Process:Process.SelectedText.Value,
     Operator:Operator.SelectedText.Value
     }),
     Patch('Aluminium Output', ExistingOrder, { Finish: Now() }))

    Hope this helps!

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Many thanks for help. It works.

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 352 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 323

#3
Mohsin Ali Profile Picture

Mohsin Ali 226

Last 30 days Overall leaderboard