Global index shared between fields

Hi there,

Is there a way of using the same Ruby variable (means a global variable - def @@index = 1) between multiple formula fields ? I would like to increment this index each time I use it in fields (especially in JSON Array field types for which I do not know the size since it is randomly defined).

Any idea?

Not in general, but for this specific case you can add a sequence field to your array to get the index.