HTTP Pagination with POST Request Body Parameters - $pageCount not incrementing when in array

$pageCount does not increment when inside an array like here:
{
“Ticket”: “{{ $(‘Login Ticket’).item.json.Ticket }}”,
“TrimResponse”: 0,
“Data”: {
“CustomerId”: 10162,
“SearchValue”: “”,
“EntriesPerPage”: 5,
“Page”: 1
}
}

This is the way i try to update the page by body-parameter:
Data.Page
{{ $pageCount + 1 }}

Information on n8n setup

  • n8n version: 1.122.4
  • Database (default: SQLite): Postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main): ?
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Ubuntu

Hey @Parintele_Damaskin,

thanks for your reply.

I tried both “Fixed” and “Expression” in Name Field with “Data.Page” in it. Both did not work.
But i´m not sure what your recommendation is.

Hi @Parintele_Damaskin ,

so in this example i have 21 TotalRecords. I have set EntriesPerPage to 5 (if i set it to 30 i will see all records but i wan´t to keep it working with paging for situations with to mutch TotalRecords for one request). It seems that the Value is not updated:

Data→Page

Here are screenshots showing the rest (with set EntriesPerPage to 30 to get it without error):

Instead of using the pagination feature’s “Name” field, build the entire JSON body as an expression that includes the incrementing page number:

  1. In your HTTP Request node, go to the Body section

  2. Set the Body to JSON mode (not using the pagination parameter feature)

  3. Replace your JSON body with this expression:

{

“Ticket”: “{{ $(‘Login Ticket’).item.json.Ticket }}”,

“TrimResponse”: 0,

“Data”: {

"CustomerId": 10162,

"SearchValue": "",

"EntriesPerPage": 5,

"Page": {{ $pageCount + 1 }}

}

}

  1. Keep the Pagination settings, but you can remove the “Parameters for Pagination” section since you’re handling it in the body expression

  2. Configure “Pagination Completed When” to detect when there are no more pages (e.g., when the response array is empty or when a specific field indicates no more data)

Hi @abdeveloper ,

thanks for your reply. I have tested what you have suggested. But now i directly get this error:

nobody can help?

Would like to know when this error happens:

What kind of error here is giving? Since it said check the Pagination Completed When setting