Using Pagination Actions in OneTrust Integrations

When you need to gather a large set of data or results, you can leverage the Pagination action in OneTrust Integrations to help retrieve, segregate, and return the results according to defined parameters. Because many APIs, including OneTrust public APIs, have defined element limits per page, pagination allows you to see all how many total elements there are and control how many times the action needs needs to loop through based on page size and number of total elements to get all the available pages.

Things to Know

  • Default pagination size is typically 20-25, but varies depending on the API used. For more information on OneTrust APIs, see the OneTrust Developer Portal and reference the desired endpoint's Request Parameters.

  • Maximum pagination size varies depending on the API used. For more information on OneTrust APIs, see the OneTrust Developer Portal and reference the desired endpoint's Request Parameters.

  • If you want to add any additional actions in a workflow that includes pagination, you must include a logic sequence to check for the final page before the integration can perform a one-time action. For more information, see Use Case: Adding Actions after Pagination

Note:

This article references a pagination use case where we are getting all subtasks for DSAR, paginating those results, and then posting them to gather all available elements.

OneTrust customers with unique or varying use cases should contact their account executive or OneTrust Support for further assistance.

To create a new integration

  1. On the Integrations menu, select Integrations.

    The Integrations screen appears.

  2. Click the Add New button.

    The Create Workflow modal appears.

  3. Provide the new workflow a name, description, and then select the given system you wish to integrate with. You must also provide an email that will receive alerts related to the workflow status.


  4. Click the Create button.

    The Integration Builder screen appears for you to begin setting up the workflow.

To set up the workflow

OneTrust Trigger

  1. The Integration Builder screen will initially appear with the Add OneTrust Trigger action for you to select what action or event will initiate the workflow.
    Note:

    Each trigger will be unique to the use case and endpoints used.

  2. Click the Built-In tab, then select the Webhook action.


  3. Ensure the Payload Type is JSON and provide a Sample in the field, if necessary.


  4. Click the Done button.

First GET call

  1. After the trigger action, click the Add Action button.
  2. Click the OneTrust tab, then select the Privacy Rights Automation > GET Finds all Subtasks action.


  3. In the Request tab, define the given query parameters. You will need to set the page size in the Size field.
    Note:

    Each OneTrust API will have its own defined page size limit. Here, we are looking to gather 20 results per page.

    For more information, see the API Reference documentation on the OneTrust Developer Portal.



  4. Click the Finish button.

Pagination Action

  1. After the first GET action, click the Add Action button.
  2. Click the Logic tab, then select the Pagination action.


  3. Click the freemarker icon to choose from the available actions currently in the workflow, then select the step you wish to paginate through.




  4. Here, we are searching for the following attributes and seeking to paginate through all elements and every page.
    • Total Elements = ${(step.http_0.totalElements)!}

    • Page Size = ${(step.http_0.size)!}



  5. Click the Finish button.

Second GET Call

  1. After the Pagination action, click the Add Action button.
  2. Click the OneTrust tab, then select the Privacy Rights Automation > GET Finds all Subtasks action.
  3. In the Request tab, you will need to select the corresponding freemarker values from the Pagination action for the Page and Size fields. Here, we are selecting the paginated values from the previous action.
    • Page = ${(step.pagination_0.page_number)!}

    • Size = ${(step.pagination_0.page_size)!}



  4. Click the Finish button.

HTTP POST Request Call

  1. After the second GET call, click the Add Action button.
  2. Click the System tab, then select the HTTP POST Request action.


  3. Select existing credentials to authorize this call, or create new credentials right here in the Integration Builder.
    Note:

    For more information, see Configuring Integration Credentials.

  4. Click the Next button.
  5. In the Request tab, provide the Request URL. Here with our generic example, this call instructs the integration to post the paginated results for each iteration of the GET request as it gets called for each page of results until the last page is found.
    Note:

    To learn more about adding additional actions after this call, see Use Case: Adding Actions after Pagination.



  6. Click the Finish button.

To activate the workflow

  1. Once you have successfully configured this integration, click the Save button and then the Activate button.
  2. You can now launch this integration whenever the initial trigger is called.
  3. For more information on managing this integration, see the following:

Use Case: Adding Actions after Pagination

If you want to add any additional actions in a workflow that includes pagination, you must include a logic step to check for the final page before the integration can perform a one-time action. Otherwise, the pagination action would assume to loop through that given action for each page iteration.

This can be achieved with Data Transformation and Conditional Logic actions to check for the last page before the one-time action is added to the workflow. The workflow below is a use case where we are getting all Consent elements with pagination, but we have included logic to post the HTTP call if the conditions of the Data Transformation action are met.