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 / Scan QR Code based on UID
Power Apps
Answered

Scan QR Code based on UID

(0) ShareShare
ReportReport
Posted on by 139

Hello Team,

 

I am developing a QR Code application. I have a QR Code, for example: qr.abc.com/c73ffd8b-293f-4144-ae28-a110525c734c .

I have a list containing Machine Number, Material Type, Material Density, Model, UID. Please find the screenshot of the list below:

sahilauzim_0-1711714455144.png

The QR Code is same as the UID.

 

I have my application. Find a screenshot below:

sahilauzim_0-1711717132523.png

 

The issue is, when I scan the QR Code (qr.abc.com/c73ffd8b-293f-4144-ae28-a110525c734c), it should automatic fill in the datacard (UID) and based on the field UID, it should autofill the values for other datacards as well. I think we should use a function called lookup.

 

Can you please give me a solution.

 

Categories:
I have the same question (0)
  • Gochix Profile Picture
    1,935 Moderator on at

    If you are using display form as your connector then you can set up the DataSource as Filter(YourDataSource, UID = uidfromscannedqr)

    Then the remaining data cards just select accordingly ThisItem.MachineNo and so on.

  • sahilauzim Profile Picture
    139 on at

    Getting error on the code

    sahilauzim_0-1711737028494.png

     

  • Gochix Profile Picture
    1,935 Moderator on at

    Filter('QR Code List', UID = First(BarcodeReader2.Barcodes).Value

     


    _____________________________________________________________________________________
    Please give a thumbs up if I resolved your issue! Please click Accept as Solution to close the topic!

  • sahilauzim Profile Picture
    139 on at

    Hello .. The code is correct, but the values are not autofilled in the data cards.

     

    1. I have put this code on the edit form of the screen.

    sahilauzim_0-1711942891488.png

    2. On each datacardvalue (text input), i have put the following code in the default property.

    sahilauzim_1-1711943000566.png

     

    sahilauzim_2-1711943039829.png

    3. On "OnScan" property of the QR Code, I did not add any code.

     

    Can you please give me a solution so that I can see the values.

  • sahilauzim Profile Picture
    139 on at
    @WarrenBelz Can you please help me with this issue as it is quite urgent.

     

     

  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    @sahilauzim ,

    From what I can see, you have the default values referring to a data source, not the record/values from the scanned code, so firstly do you also want to display these saved values after you have scanned ? You could set a Variable OnScan of the barcode reader

    UpdateContext(
     {
     varQRCode:
     LookUp(
     'QR Code List', 
     UID = First(Self.Barcodes).Value
     )
     }
    )

    then the Default (example)

    Coalesce(
     varQRCode.'Material Type',
     TheItem.'Matrial Type'
    )

    so it will show the scan code if present or the data source field if not. Note that this approach requires resetting the variable (Screen OnVisible would be a good start)

    UpdateContext({varQRCode: Blank()})

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • sahilauzim Profile Picture
    139 on at

    In fact,

    1. I have an item in sharepoint list. I have a QR Code, for example: qr.abc.com/c73ffd8b-293f-4144-ae28-a110525c734c. I want when scan the QR Code, the other fields should be filled on the datacard on the application.

    sahilauzim_0-1712053395585.png

     

    2. The QR Code

    sahilauzim_1-1712055599823.png

     

    2. I have used the code that you provided. 

    sahilauzim_2-1712056151000.png

     

    sahilauzim_4-1712056373975.png

     

     

    3. On each datacard, I have used the provided code

    sahilauzim_3-1712056200862.png



    But i'm not able to see the values on the datacard after scanning the QR Code.

    Can you please tell me where is the mistake?

     

     

  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    @sahilauzim ,

    Firstly have a look at what is in varQRCode after you scan. Put a label on the screen with

    varQRCode.UID
  • sahilauzim Profile Picture
    139 on at

    I have put a label but nothing appeared on the label after scanning the QR Code.

    sahilauzim_0-1712121069342.jpeg

    When I scan the QR Code with my camera

    sahilauzim_3-1712121386058.png

     

     

    sahilauzim_2-1712121266073.png

     

     

  • Samuel-Zhou Profile Picture
    393 on at

    I feel it is a problem with the barcode reader, because currently I cannot parse the barcode normally when I put the formula in onscan.

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard