Skip to content

Script Expressions

Script expressions offer a way of adding dynamic parameters to Board Connector. Script expressions are resolved at extraction runtime. The output of a script expression is a string. This string can be used as input for further .NET string operations.

Script expressions can be used as selection parameters for Table or DeltaQ extractions.

Syntax of Script Expressions

Script expressions use the C# syntax. They must begin and end with a hash symbol (#). The formula starts and ends with curly brackets ({}), e.g., #{ Extraction.TableName }#

Note

Expressions that are specific to Board Connector are case sensitive. Make sure to use the exact syntax as documented below.

IF-Statements

An IF-statement (ternary operator) is supported and uses the following syntax:

iif([bool condition], [string trueResult], [string falseResult])

Examples:

Input Output Description
#{ iif(DateTime.Now.Month==7, "July","Unknown")}# July In month 7 the output is "July", all else is "Unknown".
#{Extraction.ExtractionName}##{ iif(string.IsNullOrEmpty(Extraction.Context), string.Empty, "/" + Extraction.Context)}# *Extraction.Context* returns a result only with ODP extractions. With all other extraction types the result is empty.
  • If the extraction name is 'SAP_1' and the extraction type is 'Table', the resulting file path would be SAP_1/[filename].
  • If the extraction name is 'SAP_2' and the extraction type is 'ODP' and a SAP DataSource (extraction context: SAPI) is being extracted, the resulting file path would be SAP_2/SAPI/[filename].

Script Expressions based on .NET

Board Connector script expressions support the following .NET objects, properties and methods from the .NET System Namespace of Board Connector's current .NET framework:

Object, Boolean, Char, String, SByte, Byte, Int16, UInt16, Int32, UInt32, Int64, UInt64, Single, Double, Decimal, DateTime, TimeSpan, Guid, Math, Convert.

Note

The most common usage scenario is using the methods and properties of the .NET DateTime and String classes. For further information of supported .NET classes and their properties and methods including DateTime and String see the Microsoft online documentation.

Supported Keywords

The following key words are supported:

true, false, null.

List of available Script Expressions

Script expressions are usually used to determine a dynamic date based on the current date. When using script expressions in a WHERE Clause, the value must be entered in single quotation marks.

Input Description
#{ DateTime.Now.ToString("yyyyMMdd") }#
Current date in SAP format (yyyyMMdd)
#{ String.Concat(DateTime.Now.Year.ToString(), "0101") }#
Current year concatenated with "0101" (yyyy0101)
#{ String.Concat(DateTime.Now.ToString("yyyy"), "0101") }#
Current year concatenated with "0101" (yyyy0101)
#{ String.Concat(DateTime.Now.ToString("yyyyMMdd").Substring(0,4), "0101") }#
Current year concatenated with "0101" (yyyy0101)

Last update: July 19, 2024