Importing data by using an API

Import data from anywhere in your application without navigating to the Data Designer.

Procedure
  • Run the pxImportRecordsAPI activity to import data outside of the Data Designer with the following parameters:
      • dataImportPage– The page that contains all of the details required to upload data records for import. This page contains the following information:
        • pyImportPurpose Purpose of the data import.
        • pyDataImportClass Class in which records are imported.
        • pyClassName Class in which records are imported (same as pyDataImportClass).
        • pyDataImportFilePath Location of the .csv file from which records are imported.
        • pyFieldMappingsForAPI Page List property of the Embed-FieldMapping class that holds the mapping between the .csv file and the class property.
        • pyListSeparator The type of list separator that splits the records in the .csv file.
        • pyLocale The locale that is used to display the messages about the data import process.
        • pyID Unique ID of the data import process.
      • isAsynchronous Boolean value that identifies whether the data import process is asynchronous or synchronous.
      • processID Unique ID that allows you to check the data import progress. If you want to pass this ID, set its value in the dataImportPage to pyID'; otherwise, the pxImportRecordsAPI activity creates a new ID.
      • errorFile The name of the .csv file containing the erroneous records that the system encountered while processing the data for import.
  • Optional: To see the progress of the data import, call the D_pxDataImportProgress data page by passing the value of processID for your data import.
    Note: You can also use the pxImportRecordsAPI activity when you import data in the Data Designer. For more information, see Processing records and data before and after import.