+ Start a Discussion
Chidanand MChidanand M 

How To Capture the Scanned QR Code in a Variable

Hi,

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");
			
             urlEvent.setParams({
                "url": url
            });
             
             
             
         }
        
        //use an custom field using a special VF page to search and redirect to the object
        
        urlEvent.fire();
		
		}
})

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

Requirement​.

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

Thanks,
Chidanand G.M.