Define a Write to a File Action
Use the Write to a File Action to create, overwrite, or append contents to a file when a One-Step Action runs.
For example, add a One-Step Action to a threshold-based Automation Process to keep a log file of the current date and time whenever the number of open VIP Incidents exceeds a certain threshold. Use the Temporary Filename Token to create a temporary file that goes away after a One-Step Action is finished executing.
You can write to a file:
- On the machine from which the One-Step Action is run.
- On another machine on the same network.
- On a machine on a remote network, using Trusted Agents.
Users running the One-Step Action must have permissions to access and write to the file location you specify in any case.
Using a Trusted Agent with this Action may be required for SaaS customers. See Configure One-Step Actions for Trusted Agent.
To define a Write to a File Action for a One-Step Action:
- Open the One-Step Editor.
- Add a Write to a File Action to the Designer Board.
- Define properties for the Write to a File Action:
Option Description Name Provide a display name for the Action. Filename Provide the fully qualified path and name of the file that you want to create (using text and/or tokens).
If you are writing to a file to a local machine or an accessible machine on your network, you can select the Ellipses button to navigate to the file location.
If you are configuring the Action to run using a Trusted Agent Group, the Ellipses button is disabled and you must type or paste the fully qualified path and file name for the remote machine.
Contents Provide text. Select the selector button to insert tokens (example: fields, system functions, prompts, expressions, stored values, metrics, and counters) directly into the text. Format Select the format of the file to create, overwrite, or append (plain text, Rich Text, or HTML).
Rich Text file size is limited to 2 MB when used with this Action. If you expect to write a large amount of Rich Text to a file, consider using a Transfer Attachments Action instead. See Define a Transfer Attachments Action.
Make sure file is written Select when the file should be written:
- By End of One-Step Action Process: The Action keeps the file open during One-Step Action execution and writes to it during each step (the file is not completely written until all of the post-steps are completed).
- Before Post-Steps Are Run: The Action writes to the file before any of the post-steps are executed.
- Before Next Sub-Step: The Action writes to the file after each Action in the One-Step Action.
The Before Next Post-Steps Are Run or Before Next Sub-Step options cannot be used with the Rich Text Format (RTF). RTF documents have close tags that do not allow files to be appended after they are created.
Overwrite existing file Select this check box to overwrite an existing file. Clear the check box to append the contents to the file.
- Define the Annotations for a One-Step Action.
- Select Save.
Configuring the Write to a File Action for Trusted Agents
To configure the Write to a File Action to run on a remote network, follow the steps in Configure One-Step Actions to Run on Trusted Agents.