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 Scanner App th...
Power Apps
Answered

Barcode Scanner App that shows a list with items that were scanned, but also looks up more info about the item in another list

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello, 

 

I'm building a Barcode scanner app to scan employees IDs. The idea is to scan an ID, the ID number is then added to a list, and that list automatically looks up that ID number on another list and give me the employees information, such as name, hire date, etc.. 

 

I am using an Excel sheet that lives in OneDrive. The document has two sheets, one with all of the employees information, and another empty where those scanned entries will go. 

 

When I originally built it directly in Excel, i was able to use a simple VLOOKUP formula to fill the empty columns based on the ID entree, but Powerapps doesn't support formulas directly from Excel..so... i'm not sure how to achieve the same result. 

 

Any ideas?

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    155,495 Most Valuable Professional on at

    Hi @Anonymous ,

    The Lookup function is Power Apps will do this. As an Example if you have the barcode reference ScannedCode in a field called EmployeeID, the list was EmployeeList and you were looking for the field HireDate, it would be available as

    Lookup(
     EmployeeList,
     EmployeeID = ScannedCode,
     HireDate
    )
    
    OR
    
    Lookup(
     EmployeeList,
     EmployeeID = ScannedCode
    ).HireDate

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I don't think I understand what you said, or maybe I didn't explain my need correctly. I'm sorry.. 

     

    If i understand what you said, I would basically be able to scan the ID and the app would then give me the hire date based on a list.

     

    What I'm trying to accomplish is scanning the ID, that data being added to a column in a list (Sharepoint List or Excel), and the columns next to it autofill with data from a different list (again, Sharepoint or Excel), so it can be referenced later.

     

    Real world scenario would be scanning all of the IDs of employees that showed up for a meeting, but only looking at that list later without having to match the data to the full employee list.


    Does that make sense? 

     

    Thank you!

  • WarrenBelz Profile Picture
    155,495 Most Valuable Professional on at

    Hi @Anonymous ,

    I answered the question in your post which was how to get the information in a similar method to VLookup in Excel.

    So if you want to write new records, you would use a Patch - you will need to change the names and add the rest of the fields - you could put this on the OnScan property of the scanner and it would add them as they scan (or on a button if you want to check)

    Patch(
     YourListName,
     Defaults(YourListName),
     {
     EmployeeID:ScannedCode,
     HireDate:
     Lookup(
     EmployeeList,
     EmployeeID = ScannedCode,
     HireDate
     ),
     EmployeeName:
     Lookup(
     EmployeeList,
     EmployeeID = ScannedCode,
     EmployeeName
     )
     }
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello @WarrenBelz ,

     

    I think i understand what you are doing now.. thank you, but i'm still not being successful. The scanning is working, but i'm getting blank results.. 

     

    Here's how my code looks:

     

    Patch(ScanList,{ID:BarcodeScanner1.Value ,Seniority:LookUp(CastList,ID=BarcodeScanner1.Value,Seniority),Name:LookUp(CastList,ID=BarcodeScanner1.Value,Name)})

     

    I'm attaching a couple of screenshots too.

     

    ScanList is the list where I want all of the records to go onto.

    CastList is the list of employees to get the data from.

     

    Thank you, 

    ScanList.png
    CastList.png
  • WarrenBelz Profile Picture
    155,495 Most Valuable Professional on at

    Thanks @Anonymous ,

    A couple of things here.

    You left out the Defaults() code - I have added it.

    Both ID and (particularly) Name are not good titles for columns/fields - you might consider changing them. 

    Patch(
     ScanList,
     Defaults(ScanList),
     {
     ID:BarcodeScanner1.Value,
     Seniority:
     LookUp(
     CastList,ID=BarcodeScanner1.Value,
     Seniority
     ),
     Name:
     LookUp(
     CastList,
     ID=BarcodeScanner1.Value,
     Name
     )
     }
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • WarrenBelz Profile Picture
    155,495 Most Valuable Professional on at

    Hi @Anonymous ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello @WarrenBelz ,

     

    Yes, it worked perfectly. Thank you very much for your help. 

     

    Could I pick your brain just for one more thing?

    As the code looks up the data on the other list and returns it, it is returning all as text. Is there a way to specify how I want the data to be displayed? For example, when it picks up Hire Dates, it's bringing in Date and Time (even though on the list with the data that information doesn't exist), but i want to get just date. 

     

    Thank you,

  • Verified answer
    WarrenBelz Profile Picture
    155,495 Most Valuable Professional on at

    Hi @Anonymous ,

    If the text is in a valid date/time format, you can use 

    Text(YourFieldName,"dd/mm/yyyy")

    or whatever your local format is.

    Happy to elaborate further - can you please close this by Accept as Solution (questions can still be posted after).

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 385

#2
Vish WR Profile Picture

Vish WR 367

#3
timl Profile Picture

timl 340 Super User 2026 Season 1

Last 30 days Overall leaderboard