[Files] Generate Filename

Q100109: [Files] Generate Filename

Generate a new, unique filename.

Parameter In/Out Description Other Info
Folder In The folder the output path will use.
Prefix In Value for filename prefix.
Postfix In Value for filename postfix.
Extension In Value for filename extension.
Prefix Separator In Choices: Dash, Dot, Space, Underscore
Value for prefix separator.
Default: Dash
General Value In General Value.
General Separator In Choices: Dash, Dot, Space, Underscore
Value for general separator.
Default: Dash
Type In Choices: Date, DateTime, Guid
Filename type.
Default: DateTime
Type Separator In Choices: Dash, Dot, Space, Underscore
Value for type separator.
Default: Dash
Postfix Separator In Choices: Dash, Dot, Space, Underscore
Value for postfix separator.
Default: Dash
Fail if Exists In Whether the module should fail if the filename already exists. Default: false
Filename Out The generated unique filename.
Pathname Out The output pathname, which is the combination of the source folder and the generated unique filename.

(Italics = required parameters)

Notes

The [Files] Generate Filename module is useful for generating a unique filename at the time a job is run. The combination of input parameters allows some tailoring of the filename to a general format you might desire to use. The parameter Folder is the intended folder that the file will be used or created in. The Type parameter allows the specification of a general type of unique data to use for the filename and is determined at runtime and supports options for Date, DateTime and Guid.

Here we use an example with all the default values, and specifying the following options for the parameters that you must supply.

Folder: T:\Temp
Prefix: SampleData
General Value: SetA
Extension: CSV

When run, thie could generate a filename, with path, that looks like this following example, on the Filepath output parameter.

T:\Temp\SampleData-SetA-2022-02-14-15-45-31-Export.csv
 
Last Updated:
10/3/2023 1:07:26 AM
JobServer.NET Knowledgebase © 2025