Sample Payroll Transformation Formula for HCM Spreadsheet Data Loader

In this example, the transformation formula specifies the transformation mechanism for an incoming pipe separated delimited file. The formula's return values are the same as the list of attributes in the template file for the User Defined Table business object.

And this code snippet has the formula for this example.

/* Inputs */
INPUTS ARE OPERATION (text), LINENO (number), LINEREPEATNO (number),POSITION1 (text), POSITION2 (text), POSITION3 (text), POSITION4 (text), POSITION5 (text), POSITION6 (text), POSITION7 (text), POSITION8 (text)
DEFAULT FOR POSITION1 IS 'NO DATA'
DEFAULT FOR POSITION2 IS 'NO DATA'
DEFAULT FOR POSITION3 IS 'NO DATA'
DEFAULT FOR POSITION4 IS 'NO DATA'
DEFAULT FOR POSITION5 IS 'NO DATA'
DEFAULT FOR LINEREPEATNO IS 1
IF OPERATION='FILETYPE' THEN
OUTPUTVALUE='DELIMITED'
ELSE IF OPERATION='DELIMITER' THEN
OUTPUTVALUE='|'
ELSE IF OPERATION='READ' THEN
OUTPUTVALUE='NONE'
ELSE IF OPERATION = 'NUMBEROFBUSINESSOBJECTS' THEN
(
OUTPUTVALUE = '1'/*Always be 1*/
RETURN OUTPUTVALUE
)
ELSE IF OPERATION = 'METADATALINEINFORMATION' THEN
(
METADATA1[1] = 'SMUDT' /*TemplateCode*/
METADATA1[2] = 'UserDefinedTable' /*FileDiscriminator*/
METADATA1[3] = 'UserDefinedTable_UserTableCode'
METADATA1[4] = 'UserDefinedTable_LegislativeDataGroupName'
METADATA1[5] = 'UserDefinedTable_UserTableName'
METADATA1[6] = 'UserDefinedTable_RangeOrMatch'
METADATA1[7] = 'UserDefinedTable_UserRowTitle'
METADATA1[8]= 'UserDefinedTable_UserKeyUnits'
RETURN METADATA1 /*You can return only one METADATA for the respective template*/
)
ELSE IF OPERATION='MAP' THEN
(
FileName = 'SMUDT'
BusinessOperation = 'HSDL'
FileDiscriminator = 'UserDefinedTable'
UserDefinedTable_UserTableCode = POSITION1
UserDefinedTable_LegislativeDataGroupName = POSITION2
UserDefinedTable_UserTableName = POSITION1
UserDefinedTable_RangeOrMatch = POSITION3
UserDefinedTable_UserRowTitle = POSITION4
UserDefinedTable_UserKeyUnits = POSITION5
RETURN BusinessOperation,FileDiscriminator,FileName,UserDefinedTable_UserTableCode,UserDefinedTable_LegislativeDataGroupName,UserDefinedTable_UserTableName,UserDefinedTable_RangeOrMatch,UserDefinedTable_UserRowTitle,UserDefinedTable_UserKeyUnits
)
ELSE
OUTPUTVALUE='NONE'
RETURN OUTPUTVALUE
/* End Formula Text */
Note: The template code needs to be used in the Fast Formula.