Adding post processing to import
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.
- Optional: Add fields to customize data import for the purpose of a custom import by
configuring the pyCustomConfiguration section.
- In Dev Studio, search for and open the pyCustomConfiguration section.
- Click Save as.
- Click Create and open.
- Define layouts and regions in your section by using a design template. For more information, see Creating sections.
- 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.
- Click Save.
- Define the logic for the data import for new and existing purposes and
fields.
- 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.
- Click Save as.
- Click Create and open.
- 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.
- 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.
- Click Save.
- In Dev Studio, search for and open the
pyCustomPostProcessing activity.
Previous topic Skipping key validation Next topic Processing records and data before and after import