Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

Adding post processing to import

Updated on April 6, 2022

Customize the import process to meet your business needs by adding post processing. For example, you can send an email when processing completes, or send data to more than one table in the database.

Note: Data deletion and data import from classes with autogenerated keys that do not have a BLOB do not support post processing.

  1. Optional: Add fields to customize data import for the purpose of a custom import by configuring the pyCustomConfiguration section.
    1. In Dev Studio, search for and open the pyCustomConfiguration section.
    2. Click Save as.
    3. Click Create and open.
    4. Define layouts and regions in your section by using a design template. For more information, see Creating sections.
    5. Add a new field to the section. For more information, see Adding UI components to a view.
      The activity that defines the logic for data import can access the work object that contains this field. If you want to collect new information, add fields to the work object class, not to another top-level page.

      The new fields are displayed in the Import records step of the data import process, for which you can enter values at run time.

    6. Click Save.
  2. Define the logic for the data import for new and existing purposes and fields.
    1. In Dev Studio, search for and open the pyCustomPostProcessing activity.
      The import wizard calls this activity when you click Import in the Import records step of the data import process.
    2. Click Save as.
    3. Click Create and open.
    4. Click the Parameters tab and add the following variables:
      • Purpose – The data import purpose.
      • UniqueFieldsList – A list of HashStringMap objects containing the unique field and value pairs in the imported .csv file. You can create and use a page for each pair in this activity.
      • ListSize – The number of values for the uniquely mapped field in the imported .csv file.
    5. Use the variables as input parameters for the activity. For example, you can:
      • Use a loop to iterate through the list of values for a uniquely mapped field in the imported .csv file.
      • Use the function @Utilities.pxGetKeyPageFromList(param.UniqueFieldsList,param.pyForEachCount) to get the page from the list at the current index. This function returns a clipboard page that you can use in the activity.
    6. Click Save.

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us