QR-to-Lead is a Salesforce Lightning mobile app that creates Lead records from scanned QR codes containing vCards. Its core functionality is drawn from the "Scan Barcodes on a Mobile Device" section in the Lightning Web Components Dev Guide.
Note: Users must have access to the Lead object. Both the Salesforce and Partner Community licenses provide this.
An early version of QR-to-Lead was used successfully by Cactusforce 2022 sponsors for scanning attendee badges. Sponsors were able to privately manage their leads (e.g. adding notes). Leads could be exported from the Salesforce desktop site using a provided custom report.
- Lightning app, record page, and utility bar
- LWC
- vCard parser
- Apex classes (2)
- Custom metadata type and data
- Permission set
- Profile
- Lead Report
- Create a Development Edition Org or use an existing one.
- Deploy this app to the org using the GitHub Salesforce Deploy Tool (see the Deployment section for details).
- Log into the org and create a new user (e.g. "QR2L User"). Assign the
QR-to-Lead User
profile and finish the normal Salesforce user activation process. A permission set is also available to provide similar access to an existing user with a different profile.
- Install the Salesforce mobile app on your iOS or Android device (Trailhead).
- Launch the Salesforce mobile app. If using a sandbox rather than a Dev Org for your environment, you will need change the server to "Sandbox".
- Sign in with the QR-to-Lead-enabled user. After a few moments, you should see a screen like the one above.
- Tap on the QR scan icon on the bottom button bar to switch to the scanning page.
- Tap on the blue "Scan QR Code" button to start the scanner and then position the QR code within the view. For convenience, use one of the QR codes below. The code will scan automatically.
- Once a QR code has been scanned and processed, a green toast will appear stating that the lead was created in Salesforce. Its basic info will also be displayed.
- Switch to the Leads tab. You should now see the lead in the list and be able to edit or delete it.
QR-to-Lead can be deployed using the GitHub Salesforce Deploy Tool.
- Enter the following info:
GitHub Owner:open-force
Repository:qr-to-lead
Branch/Tag/Commit:main
- Click "Login to Salesforce" button in the upper-right of the page and log in when prompted.
- You may be prompted to grant org access to the GitHub Salesforce Deploy Tool. Click the "Allow" button.
- The contents of the project will be listed. Click on the "Deploy" button.
- If you upon clicking you receive a "Failed error" message, refresh the page and repeat step 4 again.
The process should complete successfully within a few minutes:
Deployment Started
Status: Queued
Status: InProgress
Status: InProgress
...
Status: Completed
Deployment Complete
Custom labels contain the text used throughout the app except for the application name and the custom tab (see below). Each custom label uses the QRtoLead
category.
To change a label's value:
- In Setup, search for "Custom Label"
- Find the custom label to change and update its value. Save changes.
- Restart the Salesforce Mobile app to see the new value. You may also need to clear the Salesforce Mobile's cache.
- In Setup, search for
App Manager
- Edit
QR-to-Lead
app - Change the
App Name
field to the new value and click Save button. - Change the
App Branding
elements (image, color) if desired.
- In Setup, search for "tabs" and select "Tabs.
- Edit the "Scan" Lightning Component tab.
- Change the tab label to your new value.
- Change the tab style if desired.