AppendFile Overview

The AppendFile service allows you to append free-from text to any text-based file. Make sure that the user account has write permission and that the file exists. This service will not automatically create a non-existing file, so the WriteFile service must be used if the file does not exist.

AppendFile Use Examples

Basic AppendFile Use

This is an example that we first check if the file exists in the directory. If it does, we append the text to the original file. If it doesn’t, we create a new file.

For testing, TextAttach.txt already exists. The text in AppendFile will be written at the end of original text.

If in AppendFile, we set InsertNewLine to ‘Before’, new text will be added in a new line. This is useful if you want to use ReadFile and ReadAllLines later.

If the file doesn’t exists, AppendFile will throw the following error.