Task Factory Functions List F

 Task Factory users running version 2020.1.4 or older (released prior to May 27, 2020): There's an important Task Factory update. Please visit here for more details.

FileAppendAllText

DescriptionAppend text to the end of a file contents.
SyntaxFileAppendAllText( Path, Text [, Encoding])
ReturnsBoolean. If the path does not exist, null is returned.
Parameters
NameOptionalDescription
PathfalseThe path where the file is located.
TextfalseText to append to file contents.
EncodingtrueEncoding to use to write to file. Choices are ASCII, UNICODE, UTF7, UTF8, UTF32 or Default.
Examples
FileAppendAllText("C:\ssis\test.xml", "Wrox Professional SSIS 2012")

FileChangeExtension

DescriptionChanges the file extension from one to another.
SyntaxFileChangeExtension( Path, New_Extension )
ReturnsString. The path to the file with the new extension.
Parameters
NameOptionalDescription
PathfalseThe path to the file.
New_ExtensionfalseThe new extension of the file with or without the period. Pass in null to remove the extension.
Examples
FileChangeExtension("C:\ssis\test.xml", "txt")

FileCombinePath

DescriptionCombines the path of files together. It handles all of the checking for slashes and adds or removes them.
SyntaxFileCombinePath( Path1, Path2 )
ReturnsString. The combination of path1 and path2 with all slashes added or removed.
Parameters
NameOptionalDescription
Path1falseThe first part of the path.
Path2falseThe second part of the path.
Examples
FileCombinePath("C:\ssis", "test.xml")

FileCopy

DescriptionCopy a file from one location to another .
SyntaxFileCopy( Source, Destination [, Overwrite])
ReturnsBoolean. If the copy succeeds. Null of either parameter is null or either the source file doesn't exist.
Parameters
NameOptionalDescription
SourcefalseThe source path file path.
DestinationfalseThe destination file path.
OverwritefalseOverwrite the existing file?.
Examples
FileCopy("C:\ssis\test.xml", "C:\ssis\processedfiles\test.xml")

FileDelete

DescriptionDelete a file in the path supplied.
SyntaxFileDelete( Path )
ReturnsBoolean. True if the file was removed. False if it was not or path parameter is null
Parameters
NameOptionalDescription
PathfalseThe path where the file will be removed from.
Examples
FileDelete("C:\ssis\test")

FileExists

DescriptionCheck if the file exists in the path supplied.
SyntaxFileExists( Path )
ReturnsBoolean. True if the file exists. False if it does not or path parameter is null
Parameters
NameOptionalDescription
PathfalseThe path where the file is located.
Examples
FileExists("C:\ssis\test.xml")

FileGetCreationTime

DescriptionReturn the creation time of the file.
SyntaxFileGetCreationTime( Path )
ReturnsDateTime. If the path does not exist, the minimum date for your system is returned.
Parameters
NameOptionalDescription
PathfalseThe path where the file is located.
Examples
FileGetCreationTime("C:\ssis\test.xml")

FileGetDirectoryName

DescriptionGet the directory of a file path.
SyntaxFileGetDirectoryName( Path )
ReturnsString
Parameters
NameOptionalDescription
PathfalseThe path to the file.
Examples
FileGetDirectoryName("C:\ssis\test.xml")

FileGetExtension

DescriptionGet the extension of a file.
SyntaxFileGetExtension( Path )
ReturnsString
Parameters
NameOptionalDescription
PathfalseThe path to the file.
Examples
FileGetExtension("C:\ssis\test.xml")

FileGetFullPath

DescriptionGet the full path to a file.
SyntaxFileGetFullPath( Path )
ReturnsString
Parameters
NameOptionalDescription
PathfalseThe path to the file.
Examples
FileGetFullPath("C:\ssis\test.xml")

FileGetLastAccessTime

DescriptionReturn the time the file was last accessed.
SyntaxFileGetLastAccessTime( Path )
ReturnsDateTime. If the path does not exist, the minimum date for your system is returned.
Parameters
NameOptionalDescription
PathfalseThe path where the file is located.
Examples
FileGetLastAccessTime("C:\ssis\test.xml")

FileGetLastWriteTime

DescriptionReturn the time the file was last written to.
SyntaxFileGetLastWriteTime( Path )
ReturnsDateTime. If the path does not exist, the minimum date for your system is returned.
Parameters
NameOptionalDescription
PathfalseThe path where the file is located.
Examples
FileGetLastWriteTime("C:\ssis\test.xml")

FileGetName

DescriptionGet the name of file from a file path.
SyntaxFileGetName( Path )
ReturnsString
Parameters
NameOptionalDescription
PathfalseThe path to the file.
Examples
FileGetName("C:\ssis\test.xml")

FileGetNameWithoutExtension

DescriptionGet the extension of file from a file path.
SyntaxFileGetNameWithoutExtension( Path )
ReturnsString
Parameters
NameOptionalDescription
PathfalseThe path to the file.
Examples
FileGetNameWithoutExtension("C:\ssis\test.xml")

FileGetRandomFileName

DescriptionGet a random file name without a path
SyntaxFileGetRandomFileName( )
ReturnsString
Examples
FileGetRandomFileName()

FileGetTempFileName

DescriptionGet the name of a temporary file with a path to the temporary directory.
SyntaxFileGetTempFileName( )
ReturnsString
Examples
FileGetTempFileName()

FileGetTempPath

DescriptionGet the path to the temporary files directory.
SyntaxFileGetTempPath( )
ReturnsString
Examples
FileGetTempPath()

FileHasExtension

DescriptionDetermine whether a file has an extension.
SyntaxFileHasExtension( Path )
ReturnsBoolean
Parameters
NameOptionalDescription
PathfalseThe path to the file.
Examples
FileHasExtension("C:\ssis\test"), FileHasExtension("C:\ssis\test.xml")

FileInUse

DescriptionCheck if the file is in use for the path supplied.
SyntaxFileInUse( Path )
ReturnsBoolean. True if the file is in use. False if it is not in use or path parameter is null
Parameters
NameOptionalDescription
PathfalseThe path where the file is located.
Examples
FileInUse("C:\ssis\test.xml")

FileIsPathRooted

DescriptionGets a value indicating whether the specified path string contains a root.
SyntaxFileIsPathRooted( Path )
ReturnsBoolean
Parameters
NameOptionalDescription
pathfalseThe path to the file.
Examples
FileIsPathRooted("C:\ssis\test"), FileIsPathRooted("test.xml")

FileMove

DescriptionMove a file from one location to another.
SyntaxFileMove( Source, Destination)
ReturnsBoolean. If the move succeeds. Null of either parameter is null or either the source file doesn't exist.
Parameters
NameOptionalDescription
SourcefalseThe source path file path.
DestinationfalseThe destination file path.
Examples
FileMove("C:\ssis\test.xml", "C:\ssis\processedfiles\test.xml")

FileOrDirectoryGetPathRoot

DescriptionGet the root path to a file.
SyntaxFileOrDirectoryGetPathRoot( Path )
ReturnsString
Parameters
NameOptionalDescription
PathfalseThe path to the file.
Examples
FileOrDirectoryGetPathRoot("C:\ssis\test.xml"), FileOrDirectoryGetPathRoot("C:\ssis\test\")

FileReadAllBytes

DescriptionReturn the bytes from a specified file.
SyntaxFileReadAllBytes( Path )
ReturnsByte Array. If the path does not exist, null is returned.
Parameters
NameOptionalDescription
PathfalseThe path where the file is located.
Examples
FileReadAllBytes("C:\ssis\test.xml")

FileReadAllText

DescriptionReturn the text from a specified file.
SyntaxFileReadAllText( Path )
ReturnsString. If the path does not exist, null is returned.
Parameters
NameOptionalDescription
PathfalseThe path where the file is located.
Examples
FileReadAllText("C:\ssis\test.xml")

FileReplace

DescriptionCopy a file from one location to another and create a backup of the destination .
SyntaxFileReplace( Source, Destination, Backup_Destination )
ReturnsBoolean. If the copy succeeds. Null of either parameter is null or either the source file doesn't exist.
Parameters
NameOptionalDescription
SourcefalseThe source path file path.
DestinationfalseThe destination file path.
Backup_DestinationfalseThe path where the backup file will be created.
Examples
FileReplace("C:\ssis\test.xml", "C:\ssis\processedfiles\test.xml", "C:\ssis\processedfiles\backup\test.xml")

FileSetCreationTime

DescriptionSet the time the file was created.
SyntaxFileSetCreationTime( Path, Date_Created )
ReturnsBoolean. True if the value is set. False if either parameter is null.
Parameters
NameOptionalDescription
PathfalseThe path where the file is located.
Date_CreatedfalseThe date the file was created.
Examples
FileSetCreationTime("C:\ssis\test.xml", "7/6/2012 14:24")

FileSetLastAccessTime

DescriptionSet the time the file was last accessed.
SyntaxFileSetLastAccessTime( Path, Date_Last_Access )
ReturnsBoolean. True if the value is set. False if either parameter is null.
Parameters
NameOptionalDescription
PathfalseThe path where the file is located.
Date_Last_AccessfalseThe date the file was last accessed.
Examples
FileSetLastAccessTime("C:\ssis\test.xml", "7/6/2012 14:24")

FileSetLastWriteTime

DescriptionSet the time the file was written to accessed.
SyntaxFileSetLastWriteTime( Path, Date_Last_Written )
ReturnsBoolean. True if the value is set. False if either parameter is null.
Parameters
NameOptionalDescription
PathfalseThe path where the file is located.
Date_Last_WrittenfalseThe date the file was last written to.
Examples
FileSetLastWriteTime("C:\ssis\test.xml", "7/6/2012 14:24")

FileWriteAllBytes

DescriptionWrite bytes to the file contents.
SyntaxFileWriteAllBytes( Path, Bytes [, Encoding])
ReturnsBoolean. If the path does not exist, null is returned.
Parameters
NameOptionalDescription
PathfalseThe path where the file is located.
BytesfalseBytes to write to the file.
EncodingtrueEncoding to use to write to file. Choices are ASCII, UNICODE, UTF7, UTF8, UTF32 or Default.
Examples
FileWriteAllBytes("C:\ssis\test.xml", varBytes, "UTF8")

FileWriteAllText

DescriptionWrite text to the file contents.
SyntaxFileWriteAllText( Path, Text [, Encoding])
ReturnsBoolean. If the path does not exist, null is returned.
Parameters
NameOptionalDescription
PathfalseThe path where the file is located.
TextfalseText to write to the file.
EncodingtrueEncoding to use to write to file. Choices are ASCII, UNICODE, UTF7, UTF8, UTF32 or Default.
Examples
FileWriteAllText("C:\ssis\test.xml", "Wrox Professional SSIS 2012")

First

DescriptionAggregation that returns the first value of the group. Can only be used as part of the Advanced Aggregation component
SyntaxFirst( Value [, Condition])
ReturnsObject.
Parameters
NameOptionalDescription
ValuefalseThe value to add to the aggregation
ConditionfalseThe condition allows you to conditionally add values to the aggregation based on the expression. For instance, you could define the aggregate as First(SalesTotal, CustomerState="FL") and this would only add the value to the aggregation if the customers state was florida.
Examples
First(SalesTotal), First(SalesTotal, CustomerState="FL")

FirstDate

DescriptionReturns the first day of a specified month.
SyntaxFirstDate(), FirstDate( Date )
Returnsreturns date
Parameters
NameOptionalDescription
DatefalseDate to retrieve value from
Examples
FirstDate(), FirstDate("12/8/2011"), FirstDate(varDate), FirstDate(OrderDateColumn)

FirstDateOfNextMonth

DescriptionReturns the first day of a next month.
SyntaxFirstDateOfNextMonth(), FirstDateOfNextMonth( Date )
Returnsreturns date
Parameters
NameOptionalDescription
DatefalseDate to retrieve value from
Examples
FirstDateOfNextMonth(), FirstDateOfNextMonth("12/8/2011"), FirstDateOfNextMonth(varDate), FirstDateOfNextMonth(OrderDateColumn)

Floor

DescriptionReturns the largest integer less than or equal to the numeric value you pass to this function. For example, if you pass 3.14 to FLOOR, the function returns 3. If you pass 3.98 to FLOOR, the function returns 3. Likewise, if you pass -3.17 to FLOOR, the function returns -4.
SyntaxFLOOR( Numeric_Value )
ReturnsInteger if you pass a numeric value with declared precision between 0 and 28. Double if you pass a numeric value with declared precision greater than 28. NULL if a value passed to the function is NULL.
Parameters
NameOptionalDescription
Numeric_ValuefalseNumeric datatype. You can enter any valid task editor as long as it evaluates to numeric data.
Examples
example goes here

FormatCurrency

DescriptionReturns an expression formatted as currency
SyntaxFormatCurrency( Expression [, Digits_After_Decimal] [, Include_Leading_Digit] [, Use_Parens_For_Negative_Numbers] [, Group_Digits])
ReturnsString. Returns an expression formatted as a currency.
Parameters
NameOptionalDescription
ExpressionfalseExpression to be formatted.
Digits_After_DecimalfalseNumeric value indicating how many places are displayed to the right of the decimal. The default value is –1, which indicates that the computer's regional settings are used.
Include_Leading_DigitfalseIndicates whether a leading 0 is displayed for fractional values. Values are 0 for False, -1 for True
Use_Parens_For_Negative_NumbersfalseIndicates whether to place negative values within parentheses. Values are 0 for False, -1 for True
Group_DigitsfalseIndicates whether or not numbers are grouped using the group delimiter specified in the locale settings. Values are 0 for False, -1 for True
Examples
FormatCurrency("4589.932", 2)

FormatDateTime

DescriptionReturns an expression formatted as a date
SyntaxFormatDateTime( Expression [, Date_Format] )
ReturnsString. Returns an expression formatted as a date.
Parameters
NameOptionalDescription
ExpressionfalseDate expression to be formatted.
Date_FormatfalseNumeric value that indicates the date/time format used. If omitted, DateFormat.GeneralDate is used. Values are<br /> General Date = 0<br /> Long Date = 1<br /> Short Date = 2 <br /> Long Time = 3<br /> Short Time = 4
Examples
FormatDateTime(GetDate(), 2)

FormatNumber

DescriptionReturns an expression formatted as a number
SyntaxFormatNumber( Expression [, Digits_After_Decimal] [, Include_Leading_Digit] [, Use_Parens_For_Negative_Numbers] [, Group_Digits])
ReturnsString. Returns an expression formatted as a number.
Parameters
NameOptionalDescription
ExpressionfalseExpression to be formatted.
Digits_After_DecimalfalseNumeric value indicating how many places are displayed to the right of the decimal. The default value is –1, which indicates that the computer's regional settings are used.
Include_Leading_DigitfalseIndicates whether a leading 0 is displayed for fractional values. Values are 0 for False, -1 for True
Use_Parens_For_Negative_NumbersfalseIndicates whether to place negative values within parentheses. Values are 0 for False, -1 for True
Group_DigitsfalseIndicates whether or not numbers are grouped using the group delimiter specified in the locale settings. Values are 0 for False, -1 for True
Examples
FormatNumber("4589.932", 2)

FormatPercent

DescriptionReturns an expression formatted as a percentage.
SyntaxFormatPercent( Expression [, Digits_After_Decimal] [, Include_Leading_Digit] [, Use_Parens_For_Negative_Numbers] [, Group_Digits])
ReturnsString. Returns an expression formatted as a percentage.
Parameters
NameOptionalDescription
ExpressionfalseExpression to be formatted.
Digits_After_DecimalfalseNumeric value indicating how many places are displayed to the right of the decimal. The default value is –1, which indicates that the computer's regional settings are used.
Include_Leading_DigitfalseIndicates whether a leading 0 is displayed for fractional values. Values are 0 for False, -1 for True
Use_Parens_For_Negative_NumbersfalseIndicates whether to place negative values within parentheses. Values are 0 for False, -1 for True
Group_DigitsfalseIndicates whether or not numbers are grouped using the group delimiter specified in the locale settings. Values are 0 for False, -1 for True
Examples
FormatPercent("4589.932", 2)

FV

DescriptionReturns the future value of an investment, where you make periodic, constant payments and the investment earns a constant interest rate.
SyntaxFV( Rate, Terms, Payment [, Present_Value] [, Type] )
ReturnsNumeric.
Parameters
NameOptionalDescription
RatefalseNumeric. Interest rate earned in each period. Expressed as a decimal number. Divide the percent rate by 100 to express it as a decimal number. Must be greater than or equal to 0.
TermsfalseNumeric. Number of periods or payments. Must be greater than 0.
PaymentfalseNumeric. Payment amount due per period. Must be a negative number.
Present_ValuetrueNumeric. Current value of the investment. If you omit this argument, FV uses 0.
TypetrueInteger. Timing of the payment. Enter 1 if payment is at the beginning of period. Enter 0 if payment is at the end of period. Default is 0. If you enter a value other than 0 or 1, the Integration Service treats the value as 1.
Examples
FV(Ratevar, Termvar, Paymentvar), FV(3.25, 36, 125.50, 1200, 1)