Scripts can be used to transform property values during the ERM process.
TextOut = UCase(PropertyValue)
TextOut = replace(PropertyValue, "$", "")
if (ucase(PropertyValue) = "INV") then
TextOut = "Invoice"
end if
if (len(PropertyValue) > 3) then
TextOut = right(PropertyValue, len(PropertyValue) – 3)
else
TextOut = PropertyValue
end if
if (IsNumeric(left(PropertyValue, 1) ) ) then
TextOut = PropertyValue
else
TextOut = right(PropertyValue, len(PropertyValue) -1)
end if
'Declare variables used in script.
Dim strText
Dim strNumb
Dim strSearch
Dim strTemp
Dim intPos
Dim i
'If not value found in Property Value, then exit.
if Len(PropertyValue) = 0 then
Exit Function
end if
'String to search for.
strSearch = "** ORDER TOTAL **"
'Put text found in variable for manipulation.
strText = PropertyValue
'Search for "** ORDER TOTAL **" in text.
intPos = InStr(1, strText, strSearch, vbTextCompare)
'If header string not found, then exit.
if intPos = 0 then
Exit Function
end if
'Trim off header.
strText = Trim(Right(strText, Len(strText) - (intPos + Len(strSearch))))
'Loop through remaining text to dig out number.
For i = 1 To Len(strText)
strTemp = Mid(strText, i, 1)
'If it is numeric, then build number string.
If IsNumeric(strTemp) Then
strNumb = strNumb & strTemp
'Make sure we include decimal in number.
Else if strTemp = "." Then
strNumb = strNumb & strTemp
Else
'Number is done, so exit loop.
Exit For
End If
End If
Next
'Return the results.
TextOut = strNumb