Configure the Account Lifecycle Events playbook data import task

  • Release version: Washingtondc
  • Updated February 1, 2024
  • 6 minutes to read
  • Summarize
    Summarized using AI
    This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.

    Summary of Configure the Account Lifecycle Events playbook data import task

    This guide details the steps to configure the data import task for Account Lifecycle Events using Process Automation Designer in the Washingtondc release. It outlines the necessary roles, required tasks, and specific processes needed to effectively import data into ServiceNow.

    Show full answer Show less

    Key Features

    • Required Roles: Access to the configuration requires the snacctlc.agent role and at least one Process Automation Designer role.
    • Excel Template Creation: Users must create an Excel template to structure the import data.
    • Staging Table Setup: A staging table is needed to temporarily hold import data before transferring it to the target table.
    • Data Source Configuration: Users must create a data source and attach the Excel template to it.
    • Transform Map Configuration: Administrators must configure transform scripts to standardize input data during the import process.
    • Add Data Import Task: The configured data import task needs to be integrated into the Account Lifecycle onboarding process.

    Key Outcomes

    After following the configuration steps, users can successfully onboard customers using the Account Lifecycle Events playbook. The process includes creating an Excel template, setting up staging and target tables, and ensuring proper task integration within the onboarding workflow. This enables efficient data management and enhances the onboarding experience for users.

    Configure the data import task of Account Lifecycle Events using Playbooks.

    To configure the data import task, you must have the following roles:
    • sn_acct_lc.agent
    • One or more Playbooks roles. See Playbooks roles for details.

    The following table shows the various tasks involved in configuring the data import task.

    Table 1. Data import tasks
    Task Section
    Create the Excel template to import data to the target table. Create Excel template
    Create the staging table in which the import data can be stored before it’s moved to the target table. Create the staging table
    Create the data source and attach the template file to the record. Create the data source
    Configure the transform map. Configure the transform map
    Add the playbook activity to the Playbooks process. Add the data import task
    Note:
    The following sections describe how to configure the data import task for the location table available with the base system. The names and values used in these sections are examples but you can follow this process to configure any tables used for the data import task.

    Create Excel template

    Create the Excel template to import data to the target table:

    1. Navigate to All and enter cmn_location.list in the Search filter.
    2. Select the Personalize icon and select the columns that are to be included in the template. Enter filter conditions if necessary, select the Column options icon, and then select Export to Excel (.xlsx).
    3. Select Download to download the exported file.
    4. Open the downloaded Excel file, clear any existing data, and select Save.
    5. You can see that the file contains the columns you selected earlier. This file can be used as your Excel template for importing data.

    Create the staging table

    Create the staging table in which the import data can be stored before it’s moved to the target table:

    1. Navigate to All > System Definition > Tables.
    2. Select New and enter the following details:
      • Label: Enter a name for the location table, for example Data import for location.
      • Name: Enter the internal name of the table. For example, sn_acct_lc_account_onb_import_locations.
      • Extends table: Select Technology import row.
    3. Deselect the Create module check box and select the Controls tab.
    4. In the User role field, enter sn_acct_lc.agent and select Save.
    5. Select the Columns tab and select New. Enter the following details:
      • Type: String. All the columns must be of type String.
      • Column label: Enter a field name (column name) from the template file.
      • Column name: Enter the Column label with the u_ prefix. For example, if you entered the Column label as Street, enter u_street here.
      • Max length: Specify the maximum length for the column as required.
      Follow the preceding steps to add all the columns from the template file.
    6. Select Layout List under the Related Links. From the List view drop-down, select New and create two list views for this table:
      • ready_to_publish: Add all the logical fields to this view. This view appears when you select the Ready to publish bucket in the Data Import task record.
      • needs_attention: Add all the logical fields plus the Comments field to this view. This view appears when you select the Needs attention bucket in the Data Import task record.
    7. Select the Layout Form under the Related Links.
    8. From the View name drop-down, select New and create the import_view. Add all the logical fields plus the Comments field to this view. This view is displayed when you try to open the staging table record from the Data Import tab

    Create data source

    Create the data source and attach the template file to the record.
    1. Navigate to All > Administration > Data sources.
    2. Select New and enter the following details:
      • Name: Enter a name for the data source.
      • Import set table name: Enter the internal table name. For example, sn_acct_lc_account_onb_import_locations.
    3. Attach the template file to the data source record that you’ve created.

    Configure the transform map

    Transformation converts raw field input values into standardized values that are more meaningful to an organization. Administrators control when transformation happens by defining rules and conditions for specific fields.

    As part of the data import configuration, you must configure the following required transform scripts that are provided with the base system. To configure the transform scripts, follow these steps:

    1. Navigate to All > Transform maps.
    2. Search for the Account Lifecycle Events application.
    3. Select the Account Onboarding Customer Location transform map.
      Select the Transform Scripts tab. You can see the following scripts:
      • onComplete
      • onAfter
      • onBefore
    4. Select one of the scripts and modify it as required and select Update to save the changes.
    onComplete script
    (function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
    	//Check if there is any Needs Attention Record is present or not.
    	//If Yes, then script will create a new import set record and attach all the Needs Attention records to the new Import Set.
    	//Also, it will update the new import set reference on the import Task Table.
    	var util = new sn_acct_lc.AlonStagingRecordState();
    	util.onCompleteTransformMap(source, import_set);
    })(source, map, log, target);
    onAfter script
    (function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
    
    	// Add your code here
    	
    	var alonStagingUtil = new sn_acct_lc.AlonStagingRecordState();
    	alonStagingUtil.afterTransform(source);
    	if(source.sys_import_state == TechOnbEditableContants.SN_IMPORT_TRANFORM_IGNORED) {
    		return;
    	}
    	
    
    })(source, map, log, target);
    onBefore
    (function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
    
    	// Add your code here
    	var alonStagingUtil = new sn_acct_lc.AlonStagingRecordState();
    	var status = alonStagingUtil.beforeTransform(source.import_state);
    	if(status == TechOnbEditableContants.SN_IMPORT_TRANFORM_IGNORE) {
    		ignore = true;
    	}
    
    })(source, map, log, target);

    Add the data import task

    Add the data import task that you’ve configured to the Account lifecycle onboarding process defined in the Process Automation Designer.

    1. Navigate to All > Process Automation Designer.
    2. Select the Account lifecycle onboarding process.
    3. Navigate to the Data Capture & Validation lane and select Add an activity.
    4. Select Account lifecycle events and select the Create & View Tech Task Record.
    5. Select the Edit icon on the newly added task to view the properties.
    6. Select View all properties and select Advanced.
    7. In the General tab, enter the label name and description.
    8. In the When to start field, select With Previous. This option enables you to execute all the activities in the task in parallel.
    9. Select the Automation tab and in the Inputs section, enter the following:
      • Table: The table for which the record is being created. Select Account Lifecycle Import Task (sn_ti_core_imp_task).
      • Canceled Conditions: Specify the conditions that must be met before the task moves into the canceled state.
      • Closed Conditions: Specify the conditions that must be met before the task moves into the Closed state.
      • Onboarding Case: Select the Account Onboarding Case Record trigger to associate this record with the account onboarding case.
      • Record View: The name of the Form View that is to be displayed in the Account Lifecycle Events playbook. Enter tech_pad_imp_task_view here.
      • Responsibility Name: Select the ServiceNow Developer/Admin user role from the list. This role is assigned to the internal team members (defined in the Assign internal team responsibilities task of the Initiate stage of the playbook. See Using the Account Lifecycle Events playbook for details). Users with this role can perform the data import task.
    10. Select Add Field and enter data in the following fields from the Account Lifecycle Events Import Task table.
      • Source Table: Add the internal name of the staging table. For example, sn_acct_lc_account_onb_import_locations.
      • Target Table: Add the internal name of the target table. For example, cmn_location.
      • Data Source: Select the data source. For example, cmn_location_template.xlsx.
      • Data Import State: The default value is set to 1 (Data not loaded yet).
      • State: The default state is set to 1 (Open).
      • Type: Select Data capture.
      • Account: Select the account onboarding case associated with the case task.
      • Parent: Select the parent record associated with the account onboarding case.
      • Visible: Set this False.
    11. Enter the Subject and Description as required and select Done and then select Activate.

    After the data import task has been configured, the Account Lifecycle Events playbook can be used to onboard customers. See Using the Account Lifecycle Events playbook for details.