07-17-2024 09:27 PM
Hello,
I am calling Trustpilot API using HTTP request snap.
I have given below values in 'Next URL' and 'has next' values in HTTP request snap.
It is only giving 20 records.can you please provide your inputs?
jsonPath($, "$.[*].links[?(@.rel=='next-page')].href")[0]
jsonPath($, "$.[*].links[?(@.rel=='next-page')].href")[0].lenghth>0
Thanks,
Vijay
07-17-2024 11:45 PM - edited 07-18-2024 12:09 AM
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
07-18-2024 03:51 AM
Thank you for reply.
It did not work.I am getting only first page results.
07-19-2024 02:33 AM
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.
07-19-2024 10:31 PM
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