Placeholders in JSON
Placeholders are used to define the value of specific data field in a JSON for jobs or templates. There’s no early verification if this is resolvable, so errors may only be detected when job is being processed.
Syntax
There us a general syntax to refer to to placeholders:
${placeholder}
Distinguishing between field and optional format by pipe character, e.g.
${StartTime|a}
A field can be defined as combination of placeholder with fix text (e.g.
"title": "Created_${StartTime|dd.MM.yy HH:mm:ss}"
)To concatenate placeholders combine them in a field (e.g.
"title": "Created_${StartTime|ddd}${StartTime|dd.MM.YYYY HH:mm:ss.fff}"
)Placeholders are evaluated case-insensitively (except generic ones, which are evaluated in another way)
Variables
Variables can be referred to by the special placeholder ${var:...}
. The actual value of the variable can be defined by a specific API (see api/variables ). For usage of variables see Using Variables to Make Jobs More Flexible.
Source Fields
These fields support usage of placeholders.
Field name | Description | Formats | Supported by |
---|---|---|---|
StartTime | Time of creation of the target entry | All DateTime formats as described below | |
ProcessingHost | Alias name of the host, which processes the job. By default this is the Windows machine name of the host. | none | Service side evaluation for every field inside JobDescription |
Var | Generic variable, which is defined for the ROAD cluster For description see api/variables |
Note the variable name is evaluated case-sensitively | All fields in a job description |
Formats
DateTime Formats
The described format identifiers can be separated by any of these special characters: . (dot) , (comma) ; (semicolon) : (colon) / (slash) - (dash) ()[] (round and square brackets) (space)
If no format is specified (meaning no pipe symbol is included in the field) a default is applied: yyyy-MM-dd HH:mm:ss
Year | yy | 2 digits |
yyyy | 4 digits | |
Month | M | numeric 1 digit (2 if required) |
MM | numeric 2 digits | |
MMM | alphabetic abbreviated (using system language) | |
MMMM | alphabetic full (using system language) | |
Day of month | d | numeric 1 digit (2 if required) |
dd | numeric 2 digits | |
Weekday | ddd | alphabetic abbreviated (using system language) |
dddd | alphabetic full (using system language) | |
Hour (24h format) | H | numeric 1 digit (2 if required) |
HH | numeric 2 digits | |
Minute | m | numeric 1 digit (2 if required) |
mm | numeric 2 digits | |
Second | s | numeric 1 digit (2 if required) |
ss | numeric 2 digits | |
Second's fractional part | f | any amount of digits (from 1 to 3 digits corresponding to tenth to thousandth of a second) |
(These format specifiers are guided by .net standards: https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings. Extensions may come later, but for now we decided to support only these ones.)
Additional Format Options
Additional format options can be appended by separating pipe ("|
") characters:
L: Time is converted into the local time zone before formatting. (Without "
|L
", UTC time is formatted.)U: Time is UTC (default behavior)
+<n>d: An amount of days is added to the time (after converting to local time, if specified) to reach the beginning of another day. Example: ${StartTime|L|+7d} will create the date of beginning of the next day one week later (e.g. 2025-06-17 17:15:40 leads to 2025-06-25 0:00:00). This option is available since v1.11 of ROAD backend.
This option is mostly used in for the DPE metadata field deleteDate, which can be used to direct the Workflow system to delete the entry. It can be inserted in a jobDescription’s DPE Writer like this"metadata": { "deleteDate": "${StartTime|yyyy-MM-dd|L|+7d}" }
.
Examples
${StartTime|dd.MM.yy HH:mm:ss.fff}
${StartTime|d/MM/yyyy HH:mm}
${StartTime|H:m:s.fff}
${StartTime|yyyy-MM-dd HH:mm:ss|L}
-> formats a local time stamp${StartTime|yyyy-MM-dd HH:mm:ss|L|+14d}
-> formats a local time stamp for the next day two weeks later