How to configure Export to ICP (for DPG users) - MaksimAbelchuk/RnS_Docs GitHub Wiki

To pass data from Report Builder to ICP you need to use Workspace to share access rights to files with other users and Task Broker to run scripts.

Goal: Add custom action for report to export POS IDs to ICP service.

To be able to perform export to ICP, you have to meet following conditions first:

Step 1

Helpful links

Workspace:

  • Create new files and folders
  • Upload data (S3 clients or other)

Workspace User guide

Load data into Workspace

Workspace

  1. Create folder with name Export_to_icp_task and upload following package of files.

Download ICP.zip

  1. In the root folder of the Workspace, copy Export-to-icp.json file from the above archive;

Step 2

Helpful links

Jobs:

  • Create new job
  • Create API Token

TB User guide

Workspace User guide

Accessing Workspace

Jobs (Task broker)

  1. If Export to ICP job is not available yet, create a new job in the Jobs application and fill in the gaps:
  • Job Name
  • Job Description
  1. In the Tasks tab:
  • Click on BROWSE and select file task.py from the folder Export_to_icp_task on the Workspace.
  • OPTIONAL - Turn toggle switch on for Advanced settings
  • OPTIONAL - Check if there is actual version of python executor in the Executor image field and change.
  1. In the Parameters tab:
  • set parameter names as the following:
    • CLUSTER_CODE
    • CLUSTER_SET_CODE
    • START_DATE
    • END_DATE
    • ICP_OAUTH_URL
    • NOTIFICATIONS_SERVICE_ADDR
    • NOTIFICATION_LINK
    • PROMO_API_URL
    • VIEW_API_URL
    • VIEW_ID
    • TARGET_GROUP_NAME
  • turn toggle switch on to Show Secrets and add following secure parameters:
    • API_TOKEN_SECRET
    • API_TOKEN_ID
    • ICP_AUTH_ID
    • ICP_AUTH_SECRET
  1. Save the job by clicking the save icon icon at the top.

  2. Copy and save job ID, you can find it in the job URL once saved:

job id

Step 3

Helpful links

Workspace:

  • Share files and folders

Workspace User guide

Workspace

  1. Open file Export-to-icp.json in the root folder.

  2. Click Quick edit and navigate to the FormData part to change values of variables:

NOTE: THESE ARE LINKS FOR DEV ENV, please add relevant PREVIEW/PROD URLs:

  1. In order to make sure taskbroker response timeout is enough, set timeout parameter to 60000 ms (1 min)

timeout

  1. Click Save.

  2. OPTIONAL

Select your files/folders and Share with other Workspace users:

  • Export-to-icp.json file
  • Export_to_icp_task folder

Step 4

Workspace

In the params sub-folder on workspace, find icp.py file and make sure the audience parameter points to the correct audience value:

workspace data

Step 5

Helpful links

Report Builder Configuration:

Report builder (DPG)

To make export to ICP working, you need to make changes in the configuration data files:

  1. In the dataset.yml file add elements:
additional_settings:
  pos_id_dimension_name: POS_ID
  pos_id_db_field: POS_ID_NUMERIC
  1. In the report.yml file add elements:
custom_actions:
  title: Header.contextMenu.exportToICP
  url_template: '{FORM_APP_URL}/fill/ws/
export-to-icp?view_id={view_id}'
  1. Navigate to the Administration zone of the Report Builder:

admin zone nav

  1. Open Manage Datasets and upload dataset.yml file with new elements.

  2. Open Manage Reports and upload reports.yml file with new elements.

Step 6

Helpful links

Report Builder:

  • Create Data Table chart

RB User guide

Report builder (DPG)

  1. Go to DPG of Report Builder by the link

https://t0004-stg-platform-1.periscope-solutions.com/report-builder/report/test-dpg-table

  1. Create a View and Save it.

  2. In the contextual menu, choose Custom actions and click Export to ICP:

export to icp

  1. Form app page opens in a new tab.

To complete export, click Export to ICP button at the bottom of the page.

export to icp modal

  1. Notification message appears to confirm, that Export to ICP is completed successfully.

Step 7

Check on the ICP side that target group was created successfully.