Scripted Value

From Starfish ETL
Revision as of 20:05, 5 November 2014 by Admin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Scripted Value fields allow for extreme flexibility when assigned values to a Destination field. Basically, any function that can be performed with VB Script can be performed within a Scripted Value field. Variables can also be referenced from within the script.


Below are a few examples of how Scripted Value fields can be used.


Samples

Return the Current Date/Time Return the left-most 5 characters from “ZIPCODE” Origin field
Function ScriptedField

ScriptedField = Now()

End Function

Function ScriptedField

Dim var

var = "@@ORG:ZIPCODE@@"

ScriptedField = Left(var,5)

End Function

Trim an Origin field Return different values, based on a Variable value
Function ScriptedField

Dim var

var = "@@ORG:TYPE@@"

ScriptedField = Trim(var)

End Function

Function ScriptedField

If "@@VAR:vMyVariable@@" = "" Then

ScriptedField = "Value 1"

Else

ScriptedField = "Value 2"

End If

End Function


Press the button to test the results of your script. Keep in mind, this will not replace variable values.