<< Click to display Table of Contents >> Navigation: Templates > ScriptVar |
ScriptVars are used as wildcards in the Info text. These wildcards are very useful in combination with Templates, when standardised messages are sent frequently. You can add ScriptVars into your text at certain positions, whose values can be adjusted before sending the Info. This can make the process of sending standardised messages easier and faster.
The App ScriptVar (Templates -> ScriptVar) is available for the creation of ScriptVars. Here you can create and manage ScriptVars, which you can use afterwards while creating an Info.
Creating ScriptVars
With the App ScriptVars you have the opportunity to create ScriptVars with different types, like a selection or date field. Additionally ScriptVars can be defined with a default value and also an user defined script in order to create and adjust certain values dynamically.
In order to create a predefined ScriptVar, open the App ScriptVar (Templates -> ScriptVar) and click on (New) in the toolbar. Enter a name and optional a description for your ScriptVar in the appearing form. Later the name will be essential for the usage of the ScriptVar.
Select the type of your Scriptvar afterwards. The following types are available:
Type |
Description |
Text field |
A simple field where any value can be entered.
Result (Infopreview): |
Single selection |
A selection field where a value can be selected from a predefined list. Each value has to be separated through a line break.
Each value will be separated through a line break. Later in the preview of the Infoeditor.
|
Multiple choice |
A selection field where multiple values can be chosen. A standard value is needed. You can enter multiple standard values via the standard value field. Each value has to be seperated via a line break.
Result (Preview):
|
Date |
Provides a field for values with the format MM/DD/YYYY. When using the ScriptVar it will additionally provide a calendar widget where a date can be easily selected from a calendar.
|
Time |
A field for a time value in the format HH:MM. This format will be automatically converted into AM or PM. Additionally a selection list will be provided, where other times can be selected. Please note that the listed values are separated by a step of 15 minutes.
No default value will be defined if this field stays empty. A time from the 24 hour range will be automatically converted into the format AM or PM. |
Script |
•Here you can select a predefined script, which adjusts or fills a value dynamically into the field (e.g. the current date).
The ScriptVar “getDate” is a predefined script example which will print the current date in the preview. The script has been written in the programming language “Erlang”. “Pascal” can also be used.
A default value can be defined in the field Standard value optionally, which will be entered automatically into the field when using the ScriptVar in the Infoeditor. |
Inserting a ScriptVar
In order to insert a created ScriptVar into an Info, the menu point ScriptVars is available in the toolbar of the Infoeditor.
Open the Infoeditor (Info > Infoeditor) and select the ScriptVar through the selection list in the toolbar of the editor.
In order to add your input into the Info text, click on next.
ScriptVars can be manually added in the Info text too, without creating them before. The type Text field will be used as default. The ScriptVar can be placed in the Info text with the following syntax: [ScriptVar=Field name]. |
Example: Creating a ScriptVar and adding it into a Template
As an example we want to create a template, which will be used when a certain server is under maintenance and the affected users should be informed. In this case the person of charge can use the template with the predefined Info text, select the affected server from a list and send the predefined Info.
Please proceed as follows:
1. Create a new ScriptVar with the type Single selection.
2. Define every single server in the field Standard value, that should be selectable in the ScriptVar. Separate each entry through a line break.
3. Save the ScriptVar.
4. Open the App New Info and enter your Info text in the editor. (e.g. “The server is currently under maintenance.”)
5. Place the cursor inside the text, where you want to insert the ScriptVar and select the created ScriptVar through the field ScriptVar.
6. You can now save this info as a Template.
This template can now be used in case of a maintenance and the message can be sent without any greater effort.
Therefor open the app Template (Templates -> Template) and select the created Template with the ScriptVar.
Additionally, you can call up the template via the Dashboard on the web interface, in the menupoint New Info.
Before you send the info, you will find your placed ScriptVar in the preview and can select this.
With an click on Replace ScriptVars and show preview, the ScriptVar will be replaced with the value. After that, you can send the Info.