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 / How to scan QR code an...
Power Apps
Unanswered

How to scan QR code and have the information in the form filled in

(0) ShareShare
ReportReport
Posted on by 119
I am looking for a solution to scan a QR code and that at the time of scanning it autocompletes the information in the form.

So far I have managed to scan the QR code and read the information that is obtained from a SharePoint list.

To scan the QR code I have added the following to the OnScan property of the BarcodeSacanner element:

Refresh('List Name');;
Set(varScannedItem;LookUp('List Name';Title=BarcodeScanner1.Value));;

If(IsBlank(varScannedItem);
Notify("Location not found";NotificationType.Error);
ResetForm(SharePointForm1);;
EditForm(SharePointForm1);;
);;
To validate that the correct information is obtained I have added a tag in which I have added in the Text property the following:

BarcodeScanner1.Value

 

With the above I am verifying that you are scanning and obtaining information correctly according to the QR code that is being scanned. To display the information in the form I have inserted an edit form from the Insert in Power Apps section and this has been created with the columns of my SharePoint list.

In the form I changed the property DefaultMode to New.

In the Default property of Title_DataCard1 corresponding to the Title column of my SharePoint list I have set the name of the variable varScannedItem.Title Same for the DataCardValue1 which corresponds to the form text input I have set in the Default property varScannedItem.Title.
 
Another text field in which you want to display information is also from Área_DataCard1 I made the same settings above for the Default varScaennedItem property.Area Same for the DataCardValue2 in its Default property varScannedItem.Area.
 
I share the structure of my form to give a better understanding:
sebastianslz_0-1676409413652.png

 

With all the above I only get the scanned information on the label and the text fields within the form are not autocomplete. At the end of scanning the QR code, only the error message that I declare in the OnScan property of BarcodeScanner "Location not found" is displayed.
 
Is there something you are doing wrong so that the information on the form is not filled in?
Categories:
I have the same question (0)
  • TheRobRush Profile Picture
    11,128 Moderator on at

    I am curious what will happen if you change to this

    Refresh('List Name');
    
    Switch(
     Sum(AddColumns(Filter('List Name',Title=BarcodeScanner1.Value),"redeemed",1),redeemed),
     0, Notify("Location not found",NotificationType.Error),
     Set(varScannedItem;LookUp('List Name';Title=BarcodeScanner1.Value)); 
     ResetForm(SharePointForm1);
     EditForm(SharePointForm1)
     )
    

     

    You will need to change the punctuation to your regional ones, I tried typing yours to start but not sure difference between single and double ;  so figured better to type the way I am sure of and let you fix

  • sebastianslz Profile Picture
    119 on at

    @TheRobRush Thanks for your answer, what do you mean by "redeemed" and the value 1, what should I add in my case?

  • TheRobRush Profile Picture
    11,128 Moderator on at

    Keep them as is, its creating a column that can be counted. Nifty way* of bypassing delegation warnings for countrows

  • sebastianslz Profile Picture
    119 on at
    @TheRobRush  Try it as directed and after scanning the form it goes blank with your message Getting your data.

    Any other suggestions?
  • TheRobRush Profile Picture
    11,128 Moderator on at

    What do you have in the forms item property?

  • sebastianslz Profile Picture
    119 on at

    @TheRobRush In the forms item property I have the variable varScannedItem, is this correct?

    sebastianslz_0-1676412407863.png

     

     

  • TheRobRush Profile Picture
    11,128 Moderator on at

    Out of office now, so if anyone else wants to continue assisting him feel free.

     

    @sebastianslz  id recommend next step is to add a new edit form, default mode edit, and set its item.property to LookUp('List Name', ID = varScannedItem.ID)

     

    If that works, go with it, alot of the time it is easier to keep your new & edit forms seperated

  • TheRobRush Profile Picture
    11,128 Moderator on at

    Response to your question you sent while i was tuping the previous, no not really, it should be a lookup of the source data based on id there and id of varscanneditem, try that

  • sebastianslz Profile Picture
    119 on at
    @TheRobRush  I got a little confused with this answer, how many forms should I have?

    I currently have a single form in which the DefaultMode property is set to New and with respect to what you tell me about changing the Item property of the form to:
    LookUp('List Name';ID=varScannedItem.ID)
    sebastianslz_0-1676413414240.pngsebastianslz_1-1676413422854.png
    After you have done this the form goes blank with the message Getting your data.

    Any other suggestions you can make? Something tells me that we are close to achieving it.
  • TheRobRush Profile Picture
    11,128 Moderator on at

    Add a second form and make its default mode edit, datasource your list and item same lookup formula. See if works that way

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard