How do I dynamically mail merge images, QR codes and barcodes?
In Google Drive, add your image (if not already there) by clicking New and then File Upload.
Alternatively, you can use an image from a public URL. In this case, copy the image link from the public URL and jump to Step 4.
NOTE: The steps below describe the process for merging images, but the same process applies to QR codes and barcodes. You can use an online service to generate a QR code or barcode URL, such as Google Charts QR Codes or Barcodes Inc.
Right click the image file in Google Drive and click Get Link.
Click Copy Link to copy the link in the dialog box.
In Google Sheets, create a column in your sheet and name it whatever you want, but include the tag <img>, e.g. Photo <img>
Paste the copied image file link in the desired rows in the column with the <img> tag.
Repeat the steps above for each image that you want to merge.
Advanced Feature: Resize the Original Image
You can specify the width and height of the image in pixels within the <img> tag.
In the example below, the column header Photo <img|200x100> would resize the image width to 200 pixels and height to 100 pixels for all images within that column.
NOTE: If you change the image size in your column header in Google Sheets, you also need to change the size entered in your *|merge field|* in your merge template (and vice-versa).
Advanced Feature: Formula to Combine Two Strings of Text
A formula can be used in Google Sheets to combine two separate strings of text. When used with QR codes or barcodes, the formula can be used to combine a common QR code or barcode URL component with a variable merge field. This enables unique QR codes or barcodes to be generated rapidly for numerous rows of data.
NOTE: The example below focuses on QR codes, but the same formula can be used for barcodes.
The first method combines two strings of text using the 'concat' formula.
The second method combines two strings of text simply using the '&' character.
NOTE: Method 2 can also be used where the variable merge field is in the middle of the common URL component, rather than at the end, as demonstrated in the screenshot below.