How to use a increment to show in a json string

How to use a increment to show in a json string

I need to text the return of a json file and would like to know how I increment a variable like i++ inside a json string so that to display it on the screen.

So, in my json test that I receive two line per time, I would be able to see:

Name     Increment
X            1
Y            2

It sends the same two lines again and I should have:
Name     Increment
X            1
Y            2
X            3
Y            4