Filename keywords are used to generate unique filenames for configurable fields that take filenames as input. These include certain fields available when configuring endpoints using connectors. Filename keywords are one of the types of global data elements available in Jitterbit Harmony. The other types of global data elements — project variables, global variables, and Jitterbit variables — are also available globally throughout a project. They are set differently, as described in Project Variables, Global Variables, and Jitterbit Variables, respectively. However, as all global data elements share the same namespace, their names must be unique when compared against all other global data elements.
The keywords listed in the table below are available to use in certain fields within endpoint configuration screens. The keywords are not case-sensitive. For example,
[time] is equivalent to
| ||Substituted with the current date in the format |
| ||Substituted with the file extension, if any, as set when using a file-type source. The intended use of this keyword is in a file-type target filename field.|
| ||Substituted with the base file name (that is, excluding the file extension, if any), as set when using a file-type source. The intended use of this keyword is in a file-type target filename field.|
| ||Substituted with the sequence of the file: 1 for the first, 2 for the second, and so on. Similar to the Jitterbit functions |
| ||Substituted with the current time in the format |
| ||Substituted with a GUID, a random unique identifier.|
Note that the Jitterbit variable
jitterbit.source.filename gives the complete filename, is set with each source invocation, and can be used instead of the keywords
Using Filename Keywords in Configuration Screens¶
During configuration of endpoints using connectors, you can use filename keyword substitutions in certain fields that have a variable icon . Filename keywords can be used in fields along with other input, including with other keywords or variables. These sections are covered below:
- Fields Where Keywords Can Be Used
- Selecting a Filename Keyword
- Toggling Formats Between Pill and Text
- Removing a Filename Keyword
As keywords use the same syntax as global and project variables, it is possible to create a global or project variable that has the same name. Because this can cause confusion, we recommend not creating global or project variables that have the same name as these keywords.
The keywords override any variables of the same name when the project component is evaluated.
Fields Where Keywords Can Be Used¶
Keyword substitutions are intended to be used within configurable fields that take filename(s) as input. This includes certain fields available during endpoint configuration of the connectors listed below.
Optional Settings: After Processing > Rename File (File Share, FTP, Temporary Storage, and Local Storage Read activities)
Optional Settings: Trigger File > Absolute File Path (File Share, FTP, Temporary Storage, and Local Storage Read activities)
Optional Settings: Success/Error Folder > Success Folder in Absolute Path and Error Folder in Absolute Path (FTP and Local Storage Read activities)
Filename(s) (File Share, FTP, Temporary Storage, and Local Storage Write activities)
Optional Settings: Compression > Filename(s) in Archive (File Share, FTP, Temporary Storage, and Local Storage Write activities)
Optional Settings: Success/Error Folder > Success Folder in Absolute Path and Error Folder in Absolute Path (FTP and Local Storage Write activities)
A restriction on using filename keywords in Trigger File and Success/Error Folder is described later on this page under Limitations and Workarounds.
Selecting a Filename Keyword¶
To access filename keywords, you can either click the variable icon or enter an open square bracket
[ to display a list of keywords and variables.
Within the list, the keyword or variable type is indicated by the icon next to its name:
- for filename keyword
- for global variable
- for project variable
- for Jitterbit variable
In the list, hover over the keyword name to preview information about it:
The Value that appears in the information popup is always empty for a filename keyword. A default value for a filename keyword cannot be defined in a configuration field.
Select a keyword to add to the field at the location of your cursor, anywhere in the string. The variable is displayed in a pill format similar to that shown below:
To review information about the keyword, hover over the keyword pill:
Toggling Formats Between Pill and Text¶
To change the default keyword pill format to text format, click the collapse icon :
This toggles the display of the pill format to a text format, with the variable name enclosed within square brackets
To change from a text format back to pill format, change focus off of the field, such as by clicking into another configurable field. The field input automatically returns to the default pill format.
Removing a Filename Keyword¶
To remove a filename keyword, click the remove icon :
Limitations and Workarounds¶
When using filename keywords in the Trigger File or Success/Error Folder fields, a limitation is that the keywords are not resolved when using the trigger file or creating the success or error file, respectively.
For example, let's say you have a source file named
customers.csv and the current date is October 2, 2019.
You might try to use a keyword combination like this to set the target filename:
However, because filename keywords are not resolved, instead the actual result is something like this, including the unresolved keywords still in brackets:
A workaround is to use a global variable instead of filename keywords for the target filename:
Create a global variable in a condition added to a target node of the transformation, and set that global variable to specify the source filename.
In this example, a filename has been created that uses the source filename and the current time, in UTC:
<trans> If(SourceInstanceCount() == 1, $filename_target = $jitterbit.source.filename + "_"; $filename_target += Replace(GetUTCFormattedDateTime(Now(), "UTC", false), ":", "-"); ); true; </trans>
Use the global variable (in the example, called
filename_target) as the target filename in the Success/Error Folder field.
The global variable is resolved correctly for the success or error file, respectively.
Similarly, with a source Trigger File, the use of filename keywords is not resolved correctly in a filename. As a workaround, use a global variable set to an appropriate value.