Sum in the same field

In a “SET” node how can I make a sum like this:

Current field = Current field + 1 ?

Hey @admdiegolima, welcome to the community :tada:

The exact approach would differ slightly on how your input data exactly looks like. But assuming it’s a number (and not a text looking like a number), you could use an expression like {{ $json["myInputField"] + 1 }}. Here’s a workflow showing this:

Hope this helps!

I’m new here in the community, I don’t know if I’ll be able to express myself well.

My problem is the following:

I make a request in a system called “Management Click” they send the information per page, and each page comes with 20 lines of data, I want to make a flow that after it receives the 20 lines of data it goes back to the beginning and change the variable “page” to +1

I’m new here in the community, I don’t know if I’ll be able to express myself well.

My problem is the following:

I make a request in a system called “Management Click” they send the information per page, and each page comes with 20 lines of data, I want to make a flow that after it receives the 20 lines of data it goes back to the beginning and change the variable “page” to +1

Ah, so you simply want to implement pagination @admdiegolima? The exact approach will depend on the API you are using but here’s a basic example workflow showing this for the https://reqres.in/api/users API:

The HTTP Request node uses an expression to check if we have a next_page value (and if we don’t have that value yet, simply use 1 instead):

image

The IF node then checks if there are more pages to process by comparing the current page number with the number of total pages received from the API. This is something you’d most likely need to adjust depending on how your API responds.

The Set node will then add 1 to the current page value whenever it runs using an expression like this:

image

Let me know if you have any questions on this.

1 Like