Source Metadata Node Tags
Overview
QIE adds a new Source Metadata category to Node Tag Lookup. These tags expose file-related values from the current source context so you can build paths, filenames, and messages dynamically without parsing the original filename yourself. These compliment the Code Wizard Functions.
This is especially helpful for archive paths "Move file to", outbound filenames, evaluated templates, and conditional scripting.
Available Tags
- {s-metadata:FILE_DIRECTORY}: The source-relative directory path. Returns an empty string ("") when the file is in the source root or Include All Subdirectories is disabled.
- Source-Relative Example:
- Source 'Path' set to: /incoming/files/source-root/
- Include All Subdirectories enabled
- File found in: /incoming/files/source-root/sub1/sub2/
- source-relative path: sub1/sub2
- So {s-metadata:FILE_DIRECTORY} returns: sub1/sub2
- {s-metadata:FILE_NAME}: The filename including the extension.
- {s-metadata:FILE_NAME_WITHOUT_EXT}: The filename without the extension.
- {s-metadata:FILE_EXT}: The file extension only.
- {s-metadata:REMOTE_IP_ADDRESS}: The remote IP address when the source context includes one; otherwise it resolves to blank.
Where to Find Them
Open Node Tag Lookup and select Source Metadata.
These tags are intended for places where node tags are supported and a current source context exists, such as:
- Archive paths
- Destination paths or filenames
- Evaluated templates
- Scripts and expressions that evaluate node tags
Common Examples
Preserve subfolders in an archive path:
/Archive/{s-metadata:FILE_DIRECTORY}
Build a timestamped outbound filename:
processed/{s-metadata:FILE_NAME_WITHOUT_EXT}_{SYSTEM_DATE[yyyyMMddHHmmss]}.{s-metadata:FILE_EXT}
Reference the original filename in a log or message:
qie.evaluateTemplate("Processing {s-metadata:FILE_NAME} from {s-metadata:FILE_DIRECTORY}")
Why This Matters
Before this enhancement, file metadata was only available in scripts via the following Code Wizard functions:
- source.getFileDirectory()
- source.getFileName()
- source.getFileNameWithoutExt()
- source.getFileExt()
- source.getRemoteIPAddress()
The new source metadata tags let you reference those values directly in templates and fields.
Notes and Limitations
FILE_DIRECTORY uses / as the separator in the resolved value.
REMOTE_IP_ADDRESS is only populated when the source format includes a usable IP address. For ordinary file paths, it is blank. Only applies to socket and DICOM sources.
When testing source "Move file to" paths in the UI, source metadata node tags cannot be resolved because a live source file is not available when testing. QIE shows a note during testing when source metadata segments cannot be evaluated. At runtime a valid source is available for proper evaluation.
Also see these related questions:
Can QIE do recursive subdirectory scanning for File, Network Share, and FTP Sources?
How to use source.getFileDirectory()?