Forum Discussion
4 Replies
- svatadaFormer Employee
Try below exp:
nextPageUrl :
jsonPath($, "$.links[?(@.rel=='next-page')].href").length > 0 ? jsonPath($, "$.links[?(@.rel=='next-page')].href")[0] : null
hasNextPage:
jsonPath($, "$.links[?(@.rel=='next-page')].href").length > 0
- VijayKasindalaNew Contributor
Thank you for reply.
It did not work.I am getting only first page results.
- ivicakoteskiNew Contributor III
Hi VijayKasindala,
There are two potential issues:
1. You are attempting to access the output data of the JSON Parser from the initial snap HTTP Client - Get, so this approach will not work. You can only access the output data of the HTTP Client - Get.
2. According to the HTTP Client Snap documentation, the 433patches21307 update has introduced an issue that changes behavior: "pagination evaluation now occurs before sending the output to the output view".
A workaround for pagination using the HTTP Client Snap has been proposed, and you can find the details at the following link: https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/3097822264/Pagination
Hope this helps!
Kind regards,
Ivica. - VijayKasindalaNew Contributor
Thank you for update.I have changed to 'REST get' snap.It is working fine.
Next URL :jsonPath($, "$entity.links[?(@.rel=='next-page')].href")[0]
HasNext : jsonPath($, "$entity.links[?(@.rel=='next-page')].href").length > 0