Functions for Import Map Expressions

You can create expressions using one or more source data columns and map them to master data attributes. For example, the Long Description attribute in Master Data may include information from the Item and Description columns of the Source Data.

The functions used to create expressions can be of type String, Math, Generic, and Calendar.

String Functions

The string functions available for creating expressions are listed in the following table.

Name

Description

Expression

Example

toDate

Converts a string value to a date value with the date format matching the date format in the context.

toDate(expression)

If Attribute1 = 10-31-1997, format = MM-dd-yyyy

Depending on locale: toDate([Attribute1]) = 10-31-1997 or 1997-10-31

toDateTime

Converts a string value to a time stamp value with the time stamp format matching the import map time stamp format.

toDateTime(expression)

If Attribute1 = 2000.01.31 12:01:01, format = yyyy.MM.dd hh:mm:ss

Depending on locale: toDateTime([Attribute1]) = 2000.01.31 PST or 12:01:01 PM

concat

Concatenates the specified character strings.

concat(expression1, expression2,.....expression30)

If Attribute1 = Item, Attribute2 = Description

concat([Attribute1],[Attribute2]) = ItemDescription

length

Returns the length, in number of characters, of a specified string. The length excludes blank characters.

length(expression)

If Attribute1 = Item

length([Attribute1]) = 4

split

Splits character string at the specified delimiter and returns the specified part of the string. Delimiter can be any regular expression or special character.

split(expression, delimiter, partNumber)

If Attribute1 = Item#Description

split([Attribute1],#,2) = Description

substring

Creates a new string of specified length, starting from the specified character number in the original string.

substring(expression, startPosition, length)

If Attribute1 = ItemDescription

substring([Attribute1],0,4) = Item

insert

Inserts a specified character string into the specified location in another character string.

insert(expression1, integer1, expression2)

If Attribute1 = ItemDescription, Attribute2 = Long

insert([Attribute1],5,[Attribute2]) = ItemLongDescription

newLine

Inserts a newline character at the end of the specified string.

newLine()

If Attribute1 = Item, Attribute2 = Description

concat([Attribute1],newLine(),[Attribute2]) =

Item

Description

uppercase

Converts a character string to uppercase.

uppercase(expression)

If Attribute1 = item

uppercase([Attribute1]) = ITEM

lowercase

Converts a character string to lowercase.

lowercase(expression)

If Attribute1 = ITEM

lowercase([Attribute1]) = item

Math Functions

The math functions available for creating expressions are listed in the following table.

Name

Description

Expression

Example

random

Returns a pseudo-random number between 0 and 1.

random()

If Attribute1 = 25

random()*([Attribute1]) = random number

round

Rounds a numeric expression to n digits of precision.

round(expression, integer)

If Attribute1 = 10.45

round([Attribute1],0) = 10

Generic Functions

The generic functions available for creating expressions are listed in the following table.

Name

Description

Expression

Example

nvl

Returns the value of expression2 if the value of expression1 is blank, else returns the value of expression1.

nvl(expression1,expression2)

If Attribute1 = blank, Attribute2 = Item, Attribute3 = Description

nvl([Attribute1],concat([Attribute2],[Attribute3])) = ItemDescription

decode

Returns the value of expression3 if the value of expression1 equals value of expression2, else returns the value of expression4.

decode(expression1,expression2,expression3,expressiosn4)

If Attribute1 = Item, Attribute2 = Item, Attribute3 = Match, Attribute4 = No Match

decode([Attribute1],[Attribute2],[Attribute3],[Attribute4]) = Match

toString

Converts an object to its string representation.

toString(expression)

If Attribute1 = 4

toString([Attribute1]) = 4

getCustomObjectValue

Returns the value of custom object attribute corresponding to the specified custom object attribute and expression.

getCustomObjectValue(customObjectApiName,customObjectReturnAttributeApiName,customObjectQueryAttributeApiName1,expression1,...customObjectQueryAttributeApiNameN,expressionN)

If CustomObject = Manufacturer Details, CustomObjectAttribute1 = Media Inc., CustomObjectAttribute2 = MI, CSV Column1 = MI

getCustomObjectValue("CustomObject","CustomObjectAttribute1","CustomObjectAttribute2",[CSV Column1]) = Media Inc.

getCategory

Returns the category corresponding to the specified From category in the given catalog mapping.

getCategory(catalogMappingName,fromCategoryCode)

If Attribute1 = Spoke Mapping, Attribute2 = Ceramic_Faucets

getCategory([Attribute1],[Attribute2]) = Faucets

where, Faucets is the To category set corresponding to the From category Ceramic_Faucets in the catalog mapping Spoke Mapping.

getItemClass

Returns the item class corresponding to the specified From Category in the given catalog mapping.

getItemClass(catalogMappingName,fromCategoryCode)

If Attribute1 = Supplier Mapping, Attribute2 = Peripheral_Devices, and

getItemClass([Attribute1],[Attribute2]) = Electronics

where, Electronics is the item class set corresponding to the From category Peripheral_Devices in the catalog mapping Supplier Mapping.

Calendar Functions

The calendar functions available for creating expressions are listed in the following table.

Name

Description

Expression

Example

currentDate

Returns the current date.

currentDate()

01/17/2017

currentTime

Returns the current date and time.

currentTime()

01/17/2017 10:30:45 AM

dayName

Returns the name of the day for a specified date.

dayName(expression)

If Attribute1 = 01/17/2000

dayName([Attribute1]) = Monday

dayOfMonth

Returns the number of the day of the month for a specified date.

dayOfMonth (expression)

If Attribute1 = 01/17/2017

dayOfMonth([Attribute1]) = 17

dayOfWeek

Returns the number of the day of the week for a specified date.

dayOfWeek (expression)

If Attribute1 = 01/17/2017

dayOfWeek([Attribute1]) = 2

dayOfYear

Returns the number of the day in the year for a specified date.

dayOfYear (expression)

If Attribute1 = 01/17/2017

dayOfYear([Attribute1]) = 17

month

Returns the number of the month for a specified date.

month(expression)

If Attribute1 = 01/17/2017

month([Attribute1]) = 1

year

Returns the year for a specified date.

year(expression)

If Attribute 1 = 01/17/2017

Year([Attribute 1]) = 2017