How to use QR code image in the Document Generator template
There are a lot of services that generate QR codes. In this article, we use this service to generate QR code image with
Send HTTP request action and use this image in the
Document Generator template:
1. Add Send HTTP request action with the API request to generate QR code in base64 image.
2. Create a new variable using the
Variables button (in this example the variable is named "QRBase64"). In the
Set variable action, add the expression below to the selected variable. In this expression we build a URL in base 64 format: "data:image/png;base64," and use the output from previously executed HTTP request action:
="data:" + [[@Actions.SendHTTPrequest.ResponseBody]].mime + ";base64," + [[@Actions.SendHTTPrequest.ResponseBody]].data
3. Add a
Generate document action. In the Document Generator template (Word document) add the created variable to the image placeholder:
[[image ([[@Variables.QRBase64]], 150, 150)]]
The full example of the actions for import can be found below in the appendix.
Note: For the case if service returns the image as a stream or bytes it can be achieved by storing this image in Site Assets library using Execute script or Send HTTP request action. Then you can use this image placeholder in the Document Generator template (Word document):
[[image ([[@Variables.ImageURLFromSiteAssets]], 150, 150)]]
Related Articles
Action: Generate QR Code
Generate QR Code action allows to generate QR code for specified text or the URL. The generated QR code can used in different ways, like can be saved to the specified library as .PNG image or inserted directly into the .pdf file using Insert image to ...
Introduction to Document Generator
What is the document generator? The "Document Generator" allows you to generate documents based on a standard Microsoft Word file filled with SharePoint list data. This can be triggered in actions used in list actions, modern forms or background ...
How to handle the lookup columns threshold in a Document Generator template for a single item
f your Document Generator Template contains more than 12 lookups that exceeds the SharePoint lookup column threshold, you may face the situation that the generated document may not include all lookup values. To overcome this problem we propose the ...
Action: Get image data
Get image data action allows you to retrieve the image data information such as geolocation and the size of the image. Example of Get image data action configuration on the current site For more information about Action Builder read Action Builder ...
Action: Generate document
Generate document action allows you to generate documents based on a standard Microsoft Word file filled with SharePoint list data. For more information about Action Builder read Action Builder Introduction article. For more information about ...