I had a requirement to generate a unique barcode at the completion of response submission.
Accomplishing this was easy, so I thought I'd share it in case anyone else needs to do this.
1. Visit
lindell.me/JsBarcode/
to see all the options available
2. Create a LS custom template, and in the startpage.pstpl within the <head> tag, add:
Code:
<script src="https://cdn.jsdelivr.net/jsbarcode/3.6.0/JsBarcode.all.min.js"></script>
(you can also place this JS locally within your template's scripts folder if you prefer)
3. Within the End Message (in source view), place the following where you want the bar code to be displayed:
<svg id="barcode"></svg>
and then insert :
<script>JsBarcode("#barcode", "{SID}{SAVEDID}");</script>
When your survey is Activated, {SID} returns your survey ID, and {SAVEDID} returns the response key. Pass this to the JS script to generate your bar code, and you'll have a unique bar code that is comprised of the surveyID plus the response ID.