4Import Your Transaction Data

This chapter contains the following:

Import Your Transaction Data

Use this topic to import transaction data into Oracle Loyalty Cloud. You can use the import functionality to create, update, or delete transaction records.

To import transaction records, perform the following tasks:

  1. Map your source data to Oracle Loyalty Cloud object attributes.

  2. Create the source Comma Separated Values (CSV) file for import.

  3. Create the import activity.

  4. Review the import activity.

Note: It's recommended that you verify your data before you import business data using Oracle Loyalty Cloud. The import process doesn't perform data validation.

How to Map Your Transaction Source Data to Target Object Attributes

To import your transaction data into Oracle Loyalty Cloud, you need to populate a CSV file with your source data and map that source data to target object attributes in Oracle Loyalty Cloud.

You need to do the following before creating the CSV file for data import:

  • Identify how your source data attributes map to the target object attributes in Oracle Loyalty Cloud.

  • Ensure that the prerequisite steps, such as understanding what attributes are required for importing your objects, are complete.

  • Understand your options for uniquely identifying the records.

  • Ensure parent records exist before importing child records.

  • Identify the target object attributes that are required in the CSV file for a successful import.

Before You Start Importing Transaction Data

You need to set certain options for some attributes in the application before you can populate the attributes. For example, you need to set up a loyalty program and import the member data before you import the transaction data, because the transaction data contains references to program and member data. Also, when importing a child record, ensure that its parent record exists in the database.

Select a Unique Identifier for Your Transaction Records

To import data into Oracle Loyalty Cloud, your CSV file must include some specific attributes that enable the import process to uniquely identify the records. The file import process uses the attribute values to automatically map your source data to the target object attributes in Oracle Loyalty Cloud.

The preferred options to uniquely identify an object record are as follows:

  • Public unique identifiers: If you're creating new records, then you can provide a user-friendly public unique identifier (attributes denoted with 'Number' and usually visible in the business object's UI). If you update a record for which you have previously provided a Number attribute, or for which a Number attribute is visible in the object's UI, you can use the Number attribute to identify the record. For the Loyalty Transaction object, the attribute is TransactionNumber.

  • Internal ID: If you're identifying a record that already exists in Oracle Loyalty Cloud, then you can use the internal ID of the record. An Internal ID is typically a system-generated unique identifier attribute with "id" in the attribute name. You can determine the internal ID of a record by exporting Oracle Loyalty Cloud object data, or by doing a transactional database query. Using an internal ID typically provides better performance and reduces the import duration. For the Loyalty Transaction object, these attributes are as follows:

    • LoyTransactionId

    • InvOrgId

    • ProdId

    • CancelledTransactionId

    • ChildTransactionId

    • ParentTransactionId

Required Attributes and Validations for Transaction Import

To import data successfully into Oracle Loyalty Cloud, your CSV file must include the required attributes. Ensure that you provide valid values for the attributes.

Note: In the following table, Product Name is listed, which is derived from Product Number and Org ID (both listed). However, this attribute appears as Product Name, or Voucher Type, in the Oracle Loyalty Cloud UI.

The following table lists the required attributes for importing new transaction records, required attributes for updating these transaction records, prerequisite setup tasks for the attributes, and specific validations, if any, for a transaction import:

Attribute Description Data Type Data Length Prerequisite Setup Task/ Import Validations Creating a Loyalty Transaction record Updating an Existing Loyalty Transaction record

TransactionNumber

The unique ID for the Loyalty Transaction record.

Text

30

None

Required

Required

MemberNumber

The member for whom the transaction is created.

Text

30

The member must exist.

Required

Not required

ProgramName

The name of the loyalty program.

text

100

The program must exist.

Conditionally required.

A value is required if ProgramNumber is empty.

Not required

ProgramNumber

The unique ID for the loyalty program.

Text

30

The program must exist.

Conditionally required.

A value is required if ProgramNumber is empty.

Not required

TypeCode

The transaction type code name.

The accepted values are ORA_TXN_ACC, ORA_TXN_RED, and so on.

Text

30

If providing a value, the value must be a valid, enabled lookup code for lookup type ORA_LOY_TXN_TYPE.

Required

Not required

SubTypeCode

The transaction subtype name. This attribute is dependent on the TypeCodeName attribute.

The accepted values are:

A. If Accrual - ORA_ACC_MCR, ORA_ACC_PROD, and so on.

B. If Redemption - ORA_RED_PROD, ORA_RED_MDT, and so on.

Text

30

If providing a value, the value must be a valid, enabled lookup code for lookup type ORA_LOY_ACCRL_TXN_SUB_TYPE or ORA_LOY_REDEM_TXN_SUB_TYPE.

Required

Not required

ProductNumber

The product that's used in the transaction.

Text

300

The product must exist.

Conditionally required.

A value is required when SubTypeCode is ORA_ACC_PROD or ORA_RED_PROD.

Optional

InvOrgId

The organization from where inventory is being picked. For example, when a transaction is created, sometimes the inventory or goods are picked from the partner and directly delivered to the customer. The transaction is created for one organization, but the inventory is being picked from a different organization.

Number

18

The product must exist.

Conditionally required.

A value is required when SubTypeCode is ORA_ACC_PROD or ORA_RED_PROD.

Optional

StatusCode

The current state of the transaction. The accepted values are ORA_TXN_STAT_IN_PROG, ORA_TXN_STAT_REJ, or ORA_TXN_STAT_PROCESSED.

ORA_TXN_STAT_IN_PROG is the default value if StatusCode isn't provided.

Text

30

If providing a value, the value must be a valid, enabled lookup code for lookup type ORA_LOY_TXN_STATUS.

Required

Optional

TransactionDate

The date when the transaction is completed. The date defaults to the current date if no value is provided.

DateTime

Not applicable

None

Required

Optional

AccrualDisputedTransactionNumber

The attribute indicates the transaction number of the accrual transaction which was incorrect when created.

Text

30

The transaction must exist.

Conditionally required.

A value is required when AccrualDisputeTypeCode is ORA_ACRL_DISPUTE_TYPE_INCOR

Optional

Points

The transaction points. This attribute corresponds to the price of the transaction in points.

Number

Not applicable

None

Conditionally required

A value is required when TypeCode is ORA_TXN_RED and SubTypeCode is ORA_RED_TRAN for the transfer point case.

Optional

You can view the Loyalty Transaction object along with all its child objects and attributes in the Manage Import Objects page of the Import Management flow. You can find attribute information like type, length, description, and so on, on this page.

Create the Source CSV File for Transaction Data

The CSV file is provided as input to the data import process. You must populate the CSV file with the data you want to import into Oracle Loyalty Cloud.

You can either create a CSV file on your own or use templates available in pre-existing mappings. To download a template, do the following:

  1. Open Tools, and click Import Management.

  2. Click the Import Objects tab to open the Import Object Details page.

  3. Select the object you're interested in the Import Object Details page and click the Download icon next to that object name.

  4. Save the template CSV file to a location on your desktop.

You must edit the template CSV file and provide valid values for the required attributes. In the following sample source file, the import CSV file uses TransactionNumber and ProgramName information from a legacy system to identify the transaction and the program records. A value is provided for ProductNumber and InvOrgId to identify the product.

TransactionNumber ProgramName MemberNumber TypeCode SubTypeCode ProductNumber InvOrgId TransactionDate AmountValue

TXN00000001

ABC Reward

MEM00000001

ORA_TXN _ACC

ORA_ACC_ PROD

CRMITEM-AS54888-00182744

204

12/11/2018 12:08:56 PM

100

TXN00000002

ABC Reward

MEM00000002

ORA_TXN _RED

ORA_RED_ PROD

CRMITEM-AS54888-00182744

204

12/11/2018 15:18:56 PM

500

In the following sample source file, the user enters TransactionNumber to identify the record, updating the TransactionDate of the transaction in Oracle Loyalty Cloud.

Note: You can only update the transaction if the transaction is in either an In Progress or in a Rejected status.
TransactionNumber TransactionDate

TXN00000001

12/11/2018 12:08:56 PM

TXN00000002

12/11/2018 15:18:56 PM

In the following sample source file, the user enters TransactionNumber to identify the transaction record, deleting the transaction record in Oracle Loyalty Cloud by the given TransactionNumber.

Note: You can only delete a transaction while it's in progress.
TransactionNumber

TXN00000001

 

TXN00000002

 

Create the Transaction Import Activity

To import data into Oracle Loyalty Cloud, you need to create an import activity and provide the CSV file as an input to the activity.

To create an import activity, do the following:

  1. Sign in as a setup user.

  2. Open Tools, and click Import Management.

  3. On the Manage Imports page, click Create Import Activity.

  4. In the Create Import Activity: Enter Import Options page, provide a name for the import activity, and select Loyalty Transaction from the Object drop-down list.

  5. In File Name, browse and upload the required CSV file, and click Next.

  6. In the Create Import Activity: Map Fields page, edit the attribute mappings if required, and click Next.

    Note: Click Validate Data to validate the mapping of the source file for unmapped columns and to check for data format issues.
  7. In the Create Import Activity: Review and Submit page, click Submit.

Review the Transaction Import Results

You can review the import results by checking for the import activity in the Manage Import Activity page. A file import activity is said to be successful when its status displays as Completed. To check the status of the import activity, do as follows:

  1. Sign in as a setup user.

  2. Open Tools, and click Import Management.

  3. On the Manage Imports page, search for the import activity that you created using one of the search criteria, such as status, name, object, and so on.

  4. Check the Status column for the import activity. The import is successful if the status displays as Completed. The other valid values for the import activity status are Queued for import, Preparing data for import, Importing data, Completed with errors, and Unsuccessful.

Note: On this page you can also quickly view the number and status of all active imports, completed imports, and unsuccessful imports that have been submitted.

Import Your Transaction Data Using Optimized Import

Use this topic to import your transaction data into Oracle Loyalty using the optimized import mode. You can use the import functionality to create, update, or delete your records.

Use this import mode to import a large number of transaction records. When importing the data, select the Enable High-Volume Import option. The optimized import mode is designed to import millions of records in one import job. This mode doesn't trigger any custom logic configured through the application composer.

Before You Start

Optimized imports use the same CSV template file as standard imports. However, before running an optimized import, you must remove the attributes in the CSV file that only support standard import and replace those attributes with the replacement attributes. For more information, see the topic Known Issue for Optimized Import.

Import Your Transaction Data In Optimized Import Mode

After you have mapped your attributes correctly, you can import your transaction data in optimized import mode.

Note: Ensure that you have imported your contact (or account or household), and member data before importing transaction data.

To import your data using the optimized import mode:

  1. Open Tools, and click Import Management.

  2. On the Manage Imports page, click Create Import Activity.

  3. On the Enter Import Options page, do the following:

    Note: Select Contact (or Account or Household), Member, then Transaction, in that order, for each import job.
    1. Enter a name for your import in the Name field (for example, Contact Import, Member Import, or Transaction Import), then select the object to import for the job from the Object field (for contact data, select Contacts; for member data, select Loyalty Member; for transaction data, select Loyalty Transaction).

    2. Select the CSV file to import (for example. MyContacts.csv, MyMembers.csv, or MyTransactions.csv) by clicking Browse beside File Name.

    3. Select the Enable High-Volume Import option in the Advanced Options section.

    4. Specify any other options as required, and click Next.

  4. On the next two pages, accept the defaults and click Next, and then click Submit Job on the last page.

  5. On the Manage Imports page, check that your job status is set to Completed.

  6. You can click your import job name to find details of your import job including any validation errors that are typically provided in the Import Attachments section.

  7. (Optional) You can also generate a diagnostic log by clicking Generate Diagnostics from the Actions field.

  8. Repeat these steps as required to import your:

    1. Member data

    2. Transaction data