function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Chidanand MChidanand M 

How To Capture the Scanned QR Code in a Variable


I have written a component with the following javascript controller to scan the scnned data.
    doInit : function(component, event, helper) {

        var urlEvent = $A.get("e.force:navigateToURL");
        //option 2 QR codes contains just the record Id 
         if (component.get("v.UrlType") == "Id Only"){
           var url = "scan://scan?callback="+encodeURIComponent("salesforce1://sObject/SCANNED_DATA/view");
                "url": url
        //use an custom field using a special VF page to search and redirect to the object

1. QR Code is having Record Id in it.
2. As soon as i scan the QR Code it gets redirected to the record. Works fine


1. I want to capture the scanned QR Code value (Which is nothing but Id of the record) in a variable.

How can i achieve my requiremnt.

Please Post your Ideas/Comments

Chidanand G.M.