How to Generate and Use QR Code in Salesforce

How to Generate & Use QR Code in Salesforce

A QR code (stands for Quick Response code) is a type of two-dimensional barcode made up of matrix of dots. It contains information in strings of characters and can be scanned with a QR scanner or using your smartphone’s camera.  

QR Code was first introduced in 1994 by Japanese firm DENSO WAVE Inc. to address the limitations of the barcode that could hold approximately 20 alphanumeric characters only.

Initially designed for the automobile industry, it’s usage has expanded exponentially. It is now used by companies in many creative ways to connect with their customers

Generic uses of QR Code includes

  • Provide a link to the company’s website
  • Link to a Google Map to provide directions
  • Link to a PayPal Account to allow people to make mobile payments
  • Redirect your audience to social network accounts
  • Point to App Store to download an app
QR Code Use Cases in Salesforce

There can be many use cases for which you can generate and use QR code in Salesforce. Some of the use case that I can think of are:

  • Create Event Attendee Badges with QR codes, scan the badge on the day of the event to mark attendance
  • Record the movement of the inventory in and out of warehouses by scanning the QR codes
  • Scan items used in a service appointment using the Field Service Lightning mobile app to record products consumed
  • Create Employee badges with QR code to mark attendance

In this blog post, we will focus on how to generate and use a QR code to manage event attendance in Salesforce. With a few declarative steps, you will not only be able to send an event registration confirmation email with QR code but also have a streamlined digital mobile solution to track who among the invited have attended the event.  

This guide will walk you through how to configure and use QR Code in Salesforce in just under 30 minutes and contains:

  • Pre-work
  • Create a Custom HTML Email Template
  • Create an Email Alert & Automation Process
  • Create a Record in Salesforce
  • Scan the QR Code using Mobile Device & Update Record

Let’s get started…

NOTE: Certain sections of the guide will appear as locked in the free preview. You can download the unlocked version of the guide in PDF format by subscribing to our “All Access” Pass through the link below.

Not an “All Access” Pass Member Yet?

Get Download Access to this & 150+ More Step-by-Step Guides with “All Access” Pass. A simple and single plan to access our entire library of courses, guides, workshops & masterclasses on Salesforce.

References & Useful URLs

17 thoughts on “How to Generate and Use QR Code in Salesforce”

  1. Hi, Great article and appreciate you sharing this knowledge with us. While these steps show you how to use QR code for invitees to scan to register their attendance on the day of the event, I would love to know how we can use QR code that we can send to invitees that they can scan and will direct them a registration page to register their attendance and will create a Contact record against the Campaign event. Once we have a list of interested people then we can send another email to with QR code that they can scan on the day of the event to update their attendance against the campaign member status. Would love to know how I can achieve this. THanks.

    1. Ashish Agarwal

      Hi Ananth, for invitees to register their attendance against the event, you will need to have a web form on Internet that they can fill. In Salesforce, there are various methods of creating web form for public to fill. You may want to refer to my blog post at where I have listed different methods to create web form and have also shown how to create a web form using one of the popular products from AppExchange called ‘FormAssembly’

      Once you have the URL to the webform, you can generate the QR code as shown in this guide.

      Hope this helps.

  2. Hi Ashish,
    Thanks for your really thoroughly explained post ! I was wondering if you had a similar solution for good old fashion barcode ? I’ve looked at the solution offered by, and I couldn’t find anything…
    Thanks !

  3. Hello I was wondering if there is a way to automate the end so that when the QR code is scanned, campaign member status is automatically changed instead of manually needing update. Thanks in advance for your help! This has been so helpful!!

    1. Hi DG, I think this is very much do-able, though it will require customization. The way I am visualizing this is through a Visualforce page and custom controller. QR code will contain the URL of the Visualforce page and will pass the Campaign Member record ID as the parameter. So when the user taps on the QR Code to open the link, it will open the VF page. On load of the VF page, we can automatically execute the apex code that will update the campaign member status and will redirect the user to the updated campaign member record.

      Something like this should be do-able using Lightning Web Component also, though this will need to be explored further.

        1. Spencer W Widman

          I am trying to implement this exact use case. Did you clever find a viable solution to scan a QR code and update a campaign member?

  4. i work for a non profit and we are trying to figure out how to use qr codes to track attendance. We have multiple exercise classes throughout the day, and currently use paper to keep track. I have successfully generated qr codes in Salesforce for each member but now want to figure out how to use those to track attendance in each individual campaign. Is there a blog post or video that could help us?

    1. Hi Jeannette, can you please elaborate more on what exactly do you mean by “how to use those to track attendance in each individual campaign”? How do you want to store attendance? Can you let me know your data model?

  5. Pingback: How to Generate and Use QR Code in Salesforce - gigminds

  6. Adwait Gogate

    Hi Ramasamy,

    Firstly, go to App Manager -> Salesforce in your phone. Select ‘Allow’ for ‘Open the supported link in an app’ setting.

    Then download the Google Lens app from this link.

    Open the Google Lens app and point it towards a QR code which is a link to a Salesforce record. The app scans the code and shows a link. Once you click on the link, it will open in the Salesforce app and you will be taken straight to that record.

    Let me know if this helps!

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top
Introducing All Access Pass