Macros for renaming and alerting
Automate MFT supports the use of macros to dynamically insert values into file names and email alerts during task execution. Macros act as placeholders that are replaced with real-time data when a task runs, allowing for flexible and context-aware automation.
Use cases
Macros are commonly used in:
- File renaming: Customize file names during transfer by embedding dynamic elements such as timestamps or original file names.
- Email alerts: Include task-specific or file-specific details in alert messages for better traceability and context.
For example, you can rename a file during archiving to include the word Archive and the current date. If the original file is my_file.txt, you can configure the rename step as:
Archive-[yyyy]-[MM]-[dd]-[OrigName]
When the task completes, Automate MFT will rename the file to something like this:
Archive-2025-07-04-my_file.txt
Macros syntax
- Macros must be enclosed in square brackets, for example,
[OrigName]. - Macros are case-sensitive.
- Date/Time macros reflect the current system time on the Agent OS or UTC if using a cloud agent.
- Macros do not reference file metadata such as last modified date.
Where to use macros
Automate MFT supports macros in two main contexts:
- File-by-file processing: File-specific macros (such as
[OrigName],[FileSize],[EmailSubject], and[EmailBody]) and date/time macros (such as[dd]and[yy]) are supported. - Post-run email steps: Task-specific macros (such as
[TaskID]and[TaskFolder]) and date/time macros (such as[dd]and[yy]) are supported.
Supported macros
|
Macro |
Description |
Example |
|---|---|---|
|
|
Destination file name including extension. If the rename operation is enabled, the |
|
|
|
Destination folder path without the file name. |
If the file is located at |
|
|
Size of the file in bytes. |
|
|
|
Unique identifier of the file, in GUID format. |
|
|
|
File extension. |
|
|
|
File name without extension. |
|
|
|
Full source path including file name. |
|
|
|
Original file name with extension. |
|
|
|
Path relative to base folder. |
|
|
|
Description of the task. |
|
|
|
Unique ID of the task execution. |
|
|
|
Name of the organizational folder where the task is located |
If the task is in All Tasks/First Level/Second Level/Third Level/, the value is |
|
|
Full folder path of the task. |
If the task is in All Tasks/First Level/Second Level/Third Level/, the value is |
|
|
Unique ID of the task. |
|
|
|
Name of the task. |
|
|
|
Comma-separated list of tags assigned to the task. |
If the task has tags PCI and HIPAA, the value is |
|
|
Actual start time (using local timezone for the private agent or UTC for the cloud agent) in the format |
|
|
|
Description of task error (only available as a post-task item). |
|
|
|
Scheduled start time (using local timezone for the private agent or UTC for the cloud agent) in the format |
|
|
|
Status of the task run. |
|
|
|
This will use the value contained in the user defined parameter. |
Whatever is currently contained in the user specified parameter. |
|
Macro |
Description |
Example |
|---|---|---|
|
|
Actual start time (using local timezone for the private agent or UTC for the cloud agent) in the format |
|
|
|
Description of task error (only available as a post-task item). |
|
|
|
Scheduled start time (using local timezone for the private agent or UTC for the cloud agent) in the format |
|
|
|
Description of the task. |
|
|
|
Unique ID of the task execution. |
|
|
|
Name of the organizational folder where the task is located |
If the task is in All Tasks/First Level/Second Level/Third Level/, the value is |
|
|
Full folder path of the task. |
If the task is in All Tasks/First Level/Second Level/Third Level/, the value is |
|
|
Unique ID of the task. |
|
|
|
Name of the task. |
|
|
|
Status of the task run. |
|
|
|
Comma-separated list of tags assigned to the task. |
If the task has tags PCI and HIPAA, the value is |
|
|
This will use the value contained in the user defined parameter. |
Whatever is currently contained in the user specified parameter. |
|
Macro |
Description |
Example |
|---|---|---|
|
|
Day of week; three-letter abbreviation. |
|
|
|
Day of week; full. |
|
|
|
Day of month; minimal representation. |
|
|
|
Day of month; two-digit representation. |
|
|
|
Hour; two-digit representation, 24-hour format. |
|
|
|
Hour; two-digit representation, 12-hour format. |
|
|
|
am/pm; two-digit representation. |
|
|
|
Month; minimal numeric representation. |
|
|
|
Month; two-digit numeric representation. |
|
|
|
Month; short representation |
|
|
|
Month; full representation. |
|
|
|
Seconds; two-digit representation. |
|
|
|
Minutes; two-digit representation. |
|
|
|
Year; two-digit representation. |
|
|
|
Year; four-digit representation. |
|
When processing files downloaded from an IMAP endpoint, additional metadata from the source email message is available through macros.
IMAP source email macros
When processing files downloaded from an IMAP endpoint, additional metadata from the source email message is available through file-specific macros. These macros can be used when processing individual attachments, including within File Loops, conditional logic, file renaming, parameters, and notification actions.
|
Macro |
Description |
Example |
|
|
Subject of the email message that contained the attachment. |
Monthly Sales Report |
|
|
The plain-text body of the email. |
|
|
|
The HTML body of the email. |
|
|
|
A convenience macro that evaluates to |
Please find the attached sales report for June. |