Load Data from File – Load HDL using Payroll Flow

The HCM Spreadsheet Loader (HSDL) is a flexible way to load data, and most Fusion HCM teams have used it.There may be cases for certain business objects for which data set preparation using HSDL is difficult for the business user which may involve certain database column having IDs. For such cases, IT team usually take it up and load the data using HCM Data Loader(HDL).But have you explored the Payroll Flow pattern for using HDL ? It gives business users a simpler route: upload a delimited file and submit a flow, with the technical setup done once by a developer.
This post walks through the approach using User Defined Table – Column Instance Values as the business object, from the one-time setup to submitting the flow and checking the result which can be enabled for a business user.

Payroll flow
Load Data from File
Business object
User Defined Table – Column Instance Values
Fast formula
Type HCM Data Loader, name XXX_HDL_TEST_FF
File format
Delimited text file, with | as the delimiter

Prerequisites

  • The role and privilege required to access the payroll flow.
  • A sample user defined table: XXX_TEST_UDT.
  • Sample data for the user defined column: GR_SA_02.
  • Sample data for the user defined row: RUH-JED.
User-defined table
User-Defined Table with row and column values

The steps below cover the one-time setup (steps 1 to 2). After that, end users only need steps 3 to 6.

1Finalize the data file format

Each line of the file holds one value, with the fields separated by a pipe (|). A sample line:

Sample data line
SA Legislative Data Group|XXX_TEST_UDT|GR_SA_02|RUH-JED|2022/01/01|4712/12/31|500
PositionFieldSample value
1Legislative Data Group nameSA Legislative Data Group
2User defined table codeXXX_TEST_UDT
3User defined column codeGR_SA_02
4Row nameRUH-JED
5Effective start date2022/01/01
6Effective end date4712/12/31
7Value500

2Define the fast formula

Create a fast formula that tells the flow how to read the file and map each position to the right attribute.

SettingValue
TypeHCM Data Loader
NameXXX_HDL_TEST_FF
XXX_HDL_TEST_FF
/* Inputs */

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 POSITION6 IS 'NO DATA'
DEFAULT FOR POSITION7 IS 'NO DATA'
DEFAULT FOR POSITION8 IS 'NO DATA'
DEFAULT FOR POSITION9 IS 'NO DATA'
DEFAULT FOR LINEREPEATNO IS 1

INPUTS ARE OPERATION (text), LINENO (number), LINEREPEATNO (number),POSITION1 (text), POSITION2 (text), POSITION3 (text), POSITION4 (text), POSITION5 (text), POSITION6 (text), POSITION7 (text), POSITION8 (text),POSITION9 (text)

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'
RETURN OUTPUTVALUE
)
ELSE IF OPERATION = 'METADATALINEINFORMATION' THEN
(
METADATA1[1] = 'UserDefinedTable' /*TemplateCode*/
METADATA1[2] = 'UserDefinedTableColumnInstance' /*FileDiscriminator*/
METADATA1[3] = 'LegislativeDataGroupName'
METADATA1[4] = 'UserTableCode'
METADATA1[5] = 'UserColumnCode'
METADATA1[6] = 'RowLowRangeOrName'
METADATA1[7] = 'EffectiveStartDate'
METADATA1[8] = 'EffectiveEndDate'
METADATA1[9] = 'Value'
RETURN METADATA1
)
ELSE IF OPERATION='MAP' THEN
(
FileName = 'UserDefinedTable'
BusinessOperation = 'MERGE'
FileDiscriminator = 'UserDefinedTableColumnInstance'
LegislativeDataGroupName = POSITION1
UserTableCode = POSITION2
UserColumnCode = POSITION3
RowLowRangeOrName = POSITION4
EffectiveStartDate = POSITION5
EffectiveEndDate = POSITION6
Value = POSITION7

RETURN BusinessOperation,FileDiscriminator,FileName,UserTableCode,LegislativeDataGroupName,UserColumnCode,RowLowRangeOrName,EffectiveStartDate,EffectiveEndDate,Value
)
ELSE
OUTPUTVALUE='NONE'
RETURN OUTPUTVALUE
/* End Formula Text */

The formula responds to a set of operations:

OperationWhat the formula returns
FILETYPEDELIMITED: the file is a delimited text file.
DELIMITER|: fields are separated by a pipe.
READNONE.
METADATALINEINFORMATIONThe template code, file discriminator and attribute names. Only one metadata can be returned for a template.
MAPThe mapping of each file position (POSITION1 to POSITION7) to the user defined table attributes.

That completes the development work. From here, the end user can prepare the file and submit the payroll flow.

3Prepare the file

Prepare the file in the format defined in Step 1 and save it as a text file on your desktop, for example UDT_Load_Batch1.txt.

4Submit the payroll flow

Submit the Load Data from File flow. Upload your file, select the fast formula XXX_HDL_TEST_FF as the transformation formula, and submit.

Submit Payroll Flow
Submit a Payroll Flow: choose the content ID, the transformation formula and upload the file.

The flow then generates the data loader template file and initiates the data loader. You can follow the progress on the flow page.

Submit Payroll Flow
Flow tasks: the template file is generated, then the data loader is initiated.

6Verify the result

Open Import and Load Data and check the Import Success and Load Success columns for your data set.

Import and Load Data page showing the data set XXX_UDT_LOAD_VALUES with its import and load status
Import and Load Data: check the import success, load success and failed lines.
Important: The flow status can show Completed even when records failed to import or load.Always verify Import Success and Load Success on this page.

Leave a Comment