Keywords
As mentioned in the File Connection Configuration, there are keywords that can be used where the File Connector creates these new files:
- Read File: If the Rename option is selected, the new name of the file (New File Name Pattern) can be specified using keywords.
- Write File: The name that is created by the action (File Name Pattern) and the file path (Write Location) can be specified by using keywords.
The available keywords and in which action configuration they can be used are shown in the this table:
Keyword | Description | Action : Configuration |
---|---|---|
accounting_entity |
The AccountingEntity
that is populated in Message Header |
Read: Not applicable Write: Write Location and File Name Pattern |
current_date
|
Current UTC date represented as
yyyy-MM-dd . Where:
|
Read: New File Name Pattern Write: File Name Pattern |
current_datetime
|
Current UTC date time represented as yyyy-MM-dd_HH-mm-ss-SSS . Where:
|
Read: New File Name Pattern Write: File Name Pattern |
|
The Custom header that is populated in Message Headers. Replace placeholder <<Name>> with the correct custom header name. |
Read: Not applicable Write: Write Location and File Name Pattern |
document_id
|
Document ID of the BOD that is
associated with the File Template that is used in the read or write file
action type. Ensure that |
Read: New File Name Pattern Write: File Name Pattern |
document_name |
Full document name as defined in ION Registry, for
BODs in format: verb_name.noun_name |
Read: Not applicable Write: Write Location and File Name Pattern |
<fieldname> |
Any field name that is defined in the File Template and
used in the read or write file action type. Ensure that the field is required in the corresponding file template. Clear the Optional flag. |
Read: New File Name Pattern Write: File Name Pattern |
location_id |
The Location that is populated in Message Header | Read: Not applicable Write: Write Location and File Name Pattern |
noun_name |
The BOD Type that is populated in Extension. | Read: Not applicable Write: Write Location and File Name Pattern |
original_extension
|
Extension of the file that is read by the Read File
action type. The BOD Type that is populated in Message Header. For Write File action type, this keyword is replaced by the value that is specified in the File Extension attribute, if available. This is the File Extension attribute that is specified in the referenced File Template. |
Read: New File Name Pattern Write: File Name Pattern |
original_filename
|
File name of the file that is read by the Read File
action type without the file extension. For Write File action type, this keyword is replaced by the value that is specified in the File Name attribute, if available. This is the File Name attribute that is specified in the referenced File Template. |
Read: New File Name Pattern Write: File Name Pattern |
source |
The Source that is populated in Message Header. |
Read: Not applicable Write: Write Location and File Name Pattern |
tenant_id |
The TenantId that is
populated in Message Header which can be used to decide the write
location |
Read: Not applicable Write: Write Location and File Name Pattern |
variation_id |
The VariationId that
is populated in Message Header |
Read: Not applicable Write: File Name Pattern |
Press Ctrl + Space to view the list of possible keywords. When a keyword is
selected, it is displayed between square brackets. For example, to rename a file using
the keyword, the New File Name Pattern can be set to: [original_filename][document_id][current_datetime].copy
.
The selected File Template configuration affects the list of keywords that are listed for use in these actions:
- Read File action
- New File Name Pattern configuration.
- Write File action
- File Name Pattern configuration
Keywords | original_ filename | original_ extenstion | document_ id | current_ datetime | current_ date | <fieldname> |
---|---|---|---|---|---|---|
No File Template Selected
in Connection Point Read/Write action
|
Read File action | Read & Write File actions | N/A | |||
Text Template Selected -
Use Attributes for File Name not selected |
Read File action | Read & Write File actions | Read & Write File actions | |||
Text Template Selected -
Use Attributes for File Name is selected |
Read & Write File actions | Read & Write File actions | Read & Write File actions | |||
Binary Template Selected -
Use Attributes for File Name not selected |
Read File action | Read & Write File actions | Only Document ID data field applies to Read & Write File actions | |||
Binary Template Selected -
Use Attributes for File Name is selected |
Read & Write File actions | Read & Write File actions |
- If one of the data fields keywords used in the file name pattern is no longer valid then the keyword is literally used in the file name. For example, when the data fields keywords no longer exists in the selected template.
- If the element/attribute/header, referenced by a keyword, does not exist in the incoming document, then a blank string is used as the value to replace it.
- If the element/attribute/header, referenced by a keyword, exists in the incoming document and is blank. A blank string is the value used to replace the keyword.
- If the element/attribute/header, referenced by a keyword, exists in the incoming document and has a value, this value is used to replace the keyword.
- If the custom header, referenced by keyword, does not exists, or has a blank value, then the keyword is literally used in the file name.
The behavior of the File Connector when handling keywords in file write location:
- Values of all keywords that are defined in the write location are retrieved from the Message Headers and are substituted in place. A confirm BOD is generated if the resulting write location does not match an existing folder unless the option Create non-existing folder(s) is set to true.
- A Confirm BOD is generated if keywords that are referenced in the write location have no value in the Message Header. The write action fails, regardless of the option Create non-existing folder(s).