Generate a text file
The action allows users to create a text file, which is then added as a form attachment, append text to an existing attachment file or overwrite the attachment file.
Template
The tab groups options that allow users to configure the action's operation mode.
1. Working mode
The drop-down list allows users to select one of the three available action working modes:
- New file – creates a completely new text file;
- Append to existing attachment – adds additional text rows to the existing file in the attachment panel;
- Overwrite existing attachment – creates a new version of the file provided in the attachment panel. replacing the previous one.
2. Category
The drop-down list allows users to specify the category for searching attachments. Apart from the categories defined by the designer in the process configuration, there are also built-in categories:
- All – searches attachments across all categories;
- Dynamic – dynamically constructs a category using variables from the editor or allows manual entry. The accepted format is either ID#Name or ID.
Attachments belonging to the category will be selected based on their ID. If searching by ID returns no results, the entered phrase will be treated as the name of a custom category (a category outside the data source), and attachments associated with this category will be returned; - None – searches for attachments that do not belong to any category.
3. Regular expression
Users can define here a regular expression used for selecting attachments for appending or overwriting. By clicking the Creator button, you can access the RegExLib creator to compose your regular expression.
4. SQL query
Choosing this option results in the processing of attachments selected based on an SQL query. The query should return a list of attachment IDs from the "WFDataAttachments" table.
Content
The tab allows users to define the content of a newly created or overwritten text file, or the content appended to an existing attachment. You can use the variables editor to include variables in the content of the text file.
Result
The tab groups options that determine the configuration of the file resulting from the action.
1. Category
The drop-down list allows users to select a category to which the attachment will be allocated. Apart from the categories defined in the process configuration by its designer, three built-in options are also available:
- Dynamic – dynamically constructs a category (using variables from the editor) or allows manual entry. The acceptable formats are ID#Name or ID. In this mode, it is possible to enter a category from within or outside the data source.
If the category is provided in the ID#Name format, the source must contain a category with the provided ID. If such a category is not found, the action will result in an error. If the category is provided as the ID only, and it is not found in the source, the entered phrase will be treated as a name of a custom category (a category from outside the data source); - None – the attachment is saved without a category.
2. Dynamic
The field becomes active after selecting the Dynamic option in the Category field.
3. Overwrite attachments with the same name
If the option to overwrite files with the same name is checked, the category of the resulting file selected in the action configuration will be ignored. The overwritten file will remain in the same category as its previous version, and a new historical version of the file will be created.
4. Page selection
The page allows users to select the encoding to be applied to the text file.
5. Custom
If a file requires different encoding than pages available in the drop-down list, enter its code or name according to the specification available in the List of encodings.
The specified encoding must be available on the server responsible for operating the Portal and Service (depending on the mode of action invocation).