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 / Datacards autofill aft...
Power Apps
Answered

Datacards autofill after scanning QR Code

(0) ShareShare
ReportReport
Posted on by 139

Hello Team, hope you are doing well.

I'm currently developing a QR Code application. I have 4 datacards namely: ID, Material Type, Material Density and title

i have used powerAutomate to generate QR-Code each time a row is created on my list. This one is working well.

 

For example I have: ID=2, Material Type=baw, Material Density=dnl and title is HD786. The QR-Code generated is 2bawdnlHD786

The issue is, I am not able to autofill the datacards after scanning the QR-Code on the application.

 

The code i have use on OnScan property of the barcode reader button is: 

UpdateContext({varbarcode:Self.Barcodes});
 
And the code for one of the text input of the datacardvalue is : 
First(varbarcode).Value
 
Can you please help how can i autofill each datacards with their corresponding values
 
Thank you ...
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    155,762 Most Valuable Professional on at

    Hi @sahilauzim ,

    If you run this OnScan

    With(
     {_Code: First(Self.Barcodes).Value},
     UpdateContext(
     {
     varBarcode:
     {
     ID: Value(Left(_Code,1)),
     Type: Mid(_Code,2,3),
     Density: Mid(_Code,5,3),
     Title: Mid(_Code,8,5)
     }
     }
     )
    )

    then the values you need should be varBarcode.IDvarBarcode.Type, varBarcode.DensityvarBarcode.Title

     

    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

    sahilauzim_0-1709809778845.png

    I'm having this error

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

    @sahilauzim ,

    Please re-check - I amended the code shortly after I posted it.

  • sahilauzim Profile Picture
    139 on at

    working good.. but it is static

    But in fact, I want it to be dynamic so that it takes the exact values for each field same as on the list.
    For example, it will display the values on each datacard based on the ID for each row.

     

    Can you please help?

    sahilauzim_0-1709811329886.png

     

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

    @sahilauzim ,

    Sorry but I am unclear what you want to do here and what do you mean by static ? Those values will update on each scan and just need to be the Default of the relevant controls that will write them to the data source.

     

    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

    Hello ...

    What i mean is, for each datacard, the value is not the same. Please find the screenshots below.

    sahilauzim_0-1709894546024.pngsahilauzim_1-1709894594234.png

     

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

    @sahilauzim ,

    So what rules define which parts of the scan code belong to which fields ?

  • sahilauzim Profile Picture
    139 on at

    I will explain in details what I have done so far.

    1. I used powerAutomate to create QR-Code each time a new item is created on my list. Please find the screenshot.

    sahilauzim_1-1709918433952.png

     

    2. When a row is created, a QR-code is generated.

    sahilauzim_4-1709919765466.png

     

    3. The code i have use for the 'bar-code reader' - Property - OnScan 

    sahilauzim_3-1709919139692.png

     

    4. on each datacard (text input), on default property, i have used 

     - varBarcode.Title
     -  varBarcode.Type
     - varBarcode.Density
     
    5. When I scan the QR-Code on my mobile
        sahilauzim_5-1709919995099.png

    The output is not the same as the item I created on my list.

     

    I hope this provides you with insight into where I may be making mistakes.

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

    @sahilauzim ,

    I don't think the code is a mistake based on what you have posted - the barcode seems to have a pipe | symbol separating some elements which is not what I based my code on.

  • sahilauzim Profile Picture
    139 on at

    Is it possible to update the code based on the delimeter i set on my QR-Code.

    sahilauzim_0-1709929993314.png

     

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 May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 483

#2
WarrenBelz Profile Picture

WarrenBelz 399 Most Valuable Professional

#3
11manish Profile Picture

11manish 327

Last 30 days Overall leaderboard