Use Pagination in an Integration

When you must fetch a large number of results in Shopify, you can use the Shopify Adapter’s pagination feature. Pagination helps you segregate the total number of results. You can specify the number of results per page according to your requirement while triggering an integration and receive sorted results.

This use case describes how to use pagination to sort results while fetching product results. Similarly, you can use pagination for the Customers, Inventory, and Orders modules. To perform this operation, you create an integration for the Shopify Adapter in Oracle Integration using pagination with the orchestrator.

  1. Create an app-driven orchestrated integration.
  2. Drag a SOAP Adapter into the integration as a trigger connection.
  3. Drag an assign action to the workspace next to the SOAP Adapter. Provide a unique name for this action, and click Create.
  4. Assign the following two variables to your integration. Specify the values to variables as follows.
    Link =””
    Check = “false”
    
  5. Click Validate, and then click Close.
  6. Drag a while action below the assign action.
  7. Provide a unique name for this action, and click Create.
  8. Set the condition for the specified variables as follows.
    Check! = “true”
  9. Click Validate, then click Close.
  10. In the mapper, map Link to page_info in the Shopify request mapper and SOAP to limit.

    Note:

    The page_info element is a unique ID required to search and access the next page in the results and limit is the maximum number of results to show per page.


  11. Drag a Shopify Adapter inside a while action.
  12. Specify the following details in the Adapter Endpoint Configuration Wizard.
    • On the Basic Info page, provide a name.
    • On the Actions page, select the Query action.
    • On the Operations page, select the Products module, the Product object, and the Retrieve list of all Products operation.
    • Review your selections on the Summary page.
  13. Drag an FTP Adapter and configure it with the .csv data file.
  14. Perform the required mapping.

  15. Drag a switch action and specify the following IF condition:
    count( components.schemas.GetAllProducts) != 0.0 & string-length( page_info) != 0.0
  16. Drag an assign action to update the specified variables as follows:
    Link = Page_info
    Check = “false”
    

    The while loop runs up to page_info in Shopify. Each page gets triggered and fetches the required data.

  17. Drag an assign action into the Otherwise branch of the switch action to update the specified variables as follows:
    Check = “true”
  18. When complete, save and activate the integration.
    The completed integration looks as follows.

  19. After successful activation, you can submit the integration and monitor the runtime in Oracle Integration. The integration keeps running until it completes all cycles of fetching product results, respectively, to each page in the FTP location.