Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Set

...

This function allows you to create

...

The function Set allows the creation of new variables that will be treated as fields (mappings), and then change that variables valuesuse 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>)}
Code Block
titleExpand to see the examples on sample code
collapsetrue
Define a variable "count" with value "0" and then use it as a normal field.

${set(count,0)}  
${count} 
 
Define a variable "newKey" with the value of field ${Key} and then use it as a normal field.

${set(newKey,${Key})}  
${newKey}

Define a variable "TodayDate" with the value of the current date calculated with Javascript and then use it as a normal field

${set(TodayDate,%{(new Date()).getDate() + "/" + ((new Date()).getMonth()+1) + "/" + (new Date()).getFullYear()})} 
${TodayDate} 
 
Info
titleNote

The function Set can be also used to change the value of existing fields (i.e., existing mappings), but in that case, it has a limitation: all occurrences of that field in the document will be replaced with the value of the latest set Set that is applied.

Info
titleNote

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 Set function.  

Prop -  A function to set custom properties to be used by Xporter during the document generation

...

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 other kind of configurationsothers.

Specification

Function Nameprop
First ParameterKey
Second parameterValue

Notation

Code Block
${prop(Key,Value)}

 


Example

Code Block
${prop(my.first.property.key,qwerty12345)}
${prop(service.api.key,84f7970c-5f70-47d9-a4f2-c75151820ba0)}
${prop(service.api.username,userAdmin)}

...

This function basically loads an image from a URL and put puts that on the document. Also, you are able to You can also specify the with width and/or height of the images.

Definition: 

!{<URL>}


Below there are some example of its usageare two examples

or 

Info

 To use the code below you need to , check here how can you to iterate that here.

After export exporting the document, the generated file is going to see this:

...

Info

 This functionality is available for Excel Templates templates on Xporter V5.3.0 and higher.

...

QRCode 

This function allows the user you to create a QRCode image on the template. This function It accepts on its as content other Xporter mappings.

Definition:

${qrcode('<content>',(Optional) <width>, (Optional) <type>)}
Code Block
titleExpand to see the examples on sample code
collapsetrue
Draws a QR Code image with the content Hello World.
${qrcode(‘Hello World’)}


Draws a QR Code image with the Issue Key as content.
${qrcode(‘${Key}’)}


Draws a QR Code image with a Javascript result as content.
${qrcode(‘%{‘${Key}’.substring(0,2)}’)}

Draws a QR Code image with the content noreply@xpand-it.com and the QR Code type email.
${qrcode(‘noreply@xpand-it.com’,email)}


Draws a QR Code image with the content Hello World and width size 200px.
${qrcode(‘Hello World’,200)}


Draws a QR Code image with the content Hello World, width size 200px and the QR Code type email.
${qrcode(‘hugo.freixo@xpand-it.com’,200,email)}
 

...

If you try to export ${qrcode(‘${wiki:Description}’)} or ${qrcode(‘${html:Description}’)}, the content of the QR Code won't be correct.

Format Mapping can be applied like: You can apply format mapping such as dateformat, numberformat, fullname or emailaddress.

...

Info

 You can learn more about QR Code types here. Note that this these types can may depend on the QR Code reader and the obtained result can may be different than the expected.

  • Text - Plain text. It's the same as not having a type defined.
  • URL - If you use this type, the reader will read the content The content will be read as a URL link.
  • Phone -  If you use this type, the reader will read the content The content will be read as a phone number.
  • Geolocation - If you use this type, the reader will read the content as GPS Coordinates. Content ExampleThe content will be read as GPS coordinates. Content example: "41.714316, -8.811993".
  • Email -  If you use this type, the reader will read the content as an EmailThe content will be read as an email.
  • Wifi - If you use this type, the reader will read the content The content will be read as a Wifi connection. Content example: T:WPA;S:NetworkName;P:NetworkPassword; 
  • VCard - If you use this type, the reader will read the The content as a VCard. Please note that not all devices are prepared to understand VCard details. More information here.

...

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).

...