Set
This function allows you to create new variables that will be treated as fields (mappings), and then use it to change the values of those variables.
The new value passed to the Set function can be plain text, an existing field (mapping) or a Functions field.
In the case of templates having Static Sections, you can create new variables outside of said Static Sections and use those variables inside the same Static Sections.
Definition:
${set(<variable name>,<new value>)} |
Note
The function Set can be also used to change the value of existing fields (i.e., existing mappings), but it has a limitation: all occurrences of that field in the document will be replaced with the value of the latest Set that is applied.
Note
The values of all the variables (mappings) created with the Set function and used on the header/footer of a template will correspond to the last value passed to the Set function.
Prop
This function allows you to define properties that will be used later by Xporter during the document processing.
Usually, integrations require some extra configuration such as security tokens, API keys and others.
Specification
Function Name | prop |
---|---|
First Parameter | Key |
Second parameter | Value |
Notation
${prop(Key,Value)}
Example
${prop(my.first.property.key,qwerty12345)} ${prop(service.api.key,84f7970c-5f70-47d9-a4f2-c75151820ba0)} ${prop(service.api.username,userAdmin)}
Image Loader
This function basically loads an image from a URL and puts that on the document. You can also specify the width and/or height of the images.
Definition:
|
Below are two examples:
or
To use the code below, check how to iterate here.
After exporting the document, the generated file is going to see this:
This functionality is available for Excel templates on Xporter V5.3.0 and higher.
QRCode
This function allows you to create a QRCode image on the template. It accepts as content other Xporter mappings.
Definition:
${qrcode('<content>',(Optional) <width>, (Optional) <type>)} |
QR Code Content
You can use any mapping on the content of the QR Code function, but you must be careful because Markups won't generate the expected result.
If you try to export ${qrcode(‘${wiki:Description}’)} or ${qrcode(‘${html:Description}’)}, the content of the QR Code won't be correct.
You can apply format mapping such as dateformat, numberformat, fullname or emailaddress.
QR Code Types
You can learn more about QR Code types here. Note that these types may depend on the QR Code reader and the obtained result may be different than expected.
- Text - Plain text. It's the same as not having a type defined.
- URL - The content will be read as a URL link.
- Phone - The content will be read as a phone number.
- Geolocation - The content will be read as GPS coordinates. Content example: "41.714316, -8.811993".
- Email - The content will be read as an email.
- Wifi - The content will be read as a Wifi connection. Content example: T:WPA;S:NetworkName;P:NetworkPassword;
- VCard - The content as a VCard. Please note that not all devices are prepared to understand VCard details. More information here.
QR Code Width
The width of the QR Code must be a value between 0 and 409 (pixels).
If the user introduces a value outside this interval, the width will be set to its default value (177px).
The user must choose a width large enough for the amount of content in the QR Code. Usually, 100px - 200px is enough.