Load Spreadsheet From File – Load HSDL Using Payroll Flow

The HCM Spreadsheet Loader (HSDL) is a flexible way to load data, and most Fusion HCM teams have used it. But have you explored the Payroll Flow pattern? 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.

Payroll flow
Load Spreadsheet from File
Business object
User Defined Table – Column Instance Values
Fast formula
Type HCM Data Loader, name XXX_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_01.
  • Sample data for the user defined row: Riyadh-Jeddah.
Edit User-Defined Table page for XXX_TEST_UDT showing column GR_SA_01 and row Riyadh-Jeddah
The sample user defined table with its column and row.

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

1Define the spreadsheet

Create the spreadsheet template for the user defined table column instance object and select the attributes you want to load. The selected attributes, in this order, define the columns of your data file.

Design page of the XXX_UDT_LOAD_VALUES spreadsheet template with the selected attributes
Spreadsheet template XXX_UDT_LOAD_VALUES with the selected attributes.

2Finalize 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_01|Riyadh-Jeddah|2025/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_01
4Row nameRiyadh-Jeddah
5Effective start date2025/01/01
6Effective end date4712/12/31
7Value500

3Define 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_TEST_FF
XXX_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'/*Always be 1*/
    RETURN OUTPUTVALUE
)
ELSE IF OPERATION = 'METADATALINEINFORMATION' THEN
(
    METADATA1[1] = 'XXX_UDT_LOAD_VALUES' /*TemplateCode*/
    METADATA1[2] = 'UserDefinedTableColumnInstance' /*FileDiscriminator*/
    METADATA1[3] = 'UserDefinedTable_LegislativeDataGroupName'
    METADATA1[4] = 'UserDefinedTable_UserTableCode'
    METADATA1[5] = 'UserDefinedTableColumnInstance_UserColumnCode'
    METADATA1[6] = 'UserDefinedTableColumnInstance_RowLowRangeOrName'
    METADATA1[7] = 'UserDefinedTableColumnInstance_EffectiveStartDate'
    METADATA1[8] = 'UserDefinedTableColumnInstance_EffectiveEndDate'
    METADATA1[9] = 'UserDefinedTableColumnInstance_Value'

    RETURN METADATA1 /*You can return only one METADATA for the respective template*/
)
ELSE IF OPERATION='MAP' THEN
(
    FileName = 'XXX_UDT_LOAD_VALUES'
    BusinessOperation = 'HSDL'
    FileDiscriminator = 'UserDefinedTableColumnInstance'

    UserDefinedTable_LegislativeDataGroupName = POSITION1
    UserDefinedTable_UserTableCode = POSITION2
    UserDefinedTableColumnInstance_UserColumnCode = POSITION3
    UserDefinedTableColumnInstance_RowLowRangeOrName = POSITION4
    UserDefinedTableColumnInstance_EffectiveStartDate = POSITION5
    UserDefinedTableColumnInstance_EffectiveEndDate = POSITION6
    UserDefinedTableColumnInstance_Value = POSITION7

    RETURN BusinessOperation,FileDiscriminator,FileName,UserDefinedTable_UserTableCode,
           UserDefinedTable_LegislativeDataGroupName,UserDefinedTableColumnInstance_UserColumnCode,
           UserDefinedTableColumnInstance_RowLowRangeOrName,UserDefinedTableColumnInstance_EffectiveStartDate,
           UserDefinedTableColumnInstance_EffectiveEndDate,UserDefinedTableColumnInstance_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.
NUMBEROFBUSINESSOBJECTS1. This value is always 1.
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.

4Prepare the file

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

5Submit the payroll flow

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

Submit a Payroll Flow page for Load Spreadsheet from File with the transformation formula XXX_TEST_FF and an uploaded file
Submit a Payroll Flow: choose the content ID, the transformation formula and upload the file.

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

Payroll flow tasks: Generate Spreadsheet Data Loader Template File completed and Initiate Spreadsheet Data Loader in progress
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