Set - A function to create and manipulate variables and change fields values

The function Set allows the creation of new variables that will be treated as fields (mappings) and then change that variables values.
The new value passed to Set function can be plain text, an existing field (mapping) or a Javascript 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>)}
Expand to see the examples on sample code
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} 
 

Note

The function Set can be also used to change the value of existing fields (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 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.  

Note

The Set function cannot be placed in the same Paragraph of Iterations, Conditional Blocks or Static Sections.

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

The main goal of this issue is to allow users 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 configurations.

Specification

Function Nameprop
First ParameterKey
Second parameterValue

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)}
  • No labels