cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Rest GET/HTTP Client trying to increment page number but after second iteration it's appending.

deeps
New Contributor II
First response
"headers":
{
"Server":"opentest"
"Date": "Thu, 02 May 2024 03:54:38 GMT"
"Content-Type":"application/json"
"Transfer-Encoding":"chunked"
"Vary":"Accept-Encoding"
"X-Current-Page":"0"
"X-Page-Count":"9"
"X-Page-Size":"2000"
"X-Total-Count":"17139"
........
}
second response/iteration
"headers":{
"Server":"opentest"
"Date": "Thu, 02 May 2024 03:54:38 GMT"
"Content-Type":"application/json"
"Transfer-Encoding":"chunked"
"Vary":"Accept-Encoding"
"X-Current-Page":"1"
"X-Page-Count":"9"
"X-Page-Size":"2000"
"X-Total-Count":"17139"
........
}
Third response/iteration
"headers":{
"Server":"opentest"
"Date": "Thu, 02 May 2024 03:54:38 GMT"
"Content-Type":"application/json"
"Transfer-Encoding":"chunked"
"Vary":"Accept-Encoding"
"X-Current-Page":"11"
"X-Page-Count":"1"
"X-Page-Size":"0"
"X-Total-Count":"0"
........
}
Has Next - parseInt($headers['X-Page-Size'])* snap.out.totalCount < $headers['X-Total-Count']
Next URL - "URL"+parseInt($headers['X-Current-Page']) + 1
Looks like my datatype for X-Current-Page is String and it's unable to convert to INT after second iteration.
Tried both HTTP Client & REST Get.
Can you please help. 


I tried methods mentioned in here https://community.snaplogic.com/t5/data-integration/rest-get-pagination-in-various-scenarios/td-p/25...
3 REPLIES 3

Vishaal_Arun
New Contributor II

Hi @deeps ,

Can you give me any sample data to try out from my end?

Thanks,

Vishaal A

deeps
New Contributor II

Hello @Vishaal_Arun , 

I have attached sample Json. 

Thank you for your help. 

deeps
New Contributor II

@Vishaal_Arun found alternative solution . Thank you for your help .