cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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

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?

1 ACCEPTED SOLUTION

Accepted Solutions

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).

View solution in original post

8 REPLIES 8
WarrenBelz
Super User III
Super User III

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.

Anonymous
Not applicable

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!

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.

 

Anonymous
Not applicable

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, 

WarrenBelz
Super User III
Super User III

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.

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.

Anonymous
Not applicable

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,

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).

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,745)