i have seen this kind of issue in other cloud-based programming systems, such as salesforce or shopify.
i think it has to do with the cloud side of coda using lots of multi-threaded code when running things on the server side, so it can scale up and support thousands of users.
we have also seen this issue when using RowId on rows generated rapidly by a formula. the RowID value remains blank for a while, and gets filled in later by the server.
we expect our code to run SEQUENTIALLY, with each loop in a FormulaMap() waiting for the previous iteration to be finished before the next one begins. and we expect each call to Random() or RandomItem() to happen in-sequence and generate a different result instantly. but it seems that is not what happens.
so we are seeing that sometimes these things are run on the coda servers in parallel and sometimes not returning a new value each time they are called.
and it looks like the location of the code has an impact. if run from the canvas, it behaves different to running it within a button or within a table column.
perhaps a CODA engineer can comment on this and provide better documentation?
I have found that i need to place RunActions() in the innermost loops of my formulas to force synchronization - but that is only available in BUTTONS, which is why using buttons above seems to work better.
in the salesforce programming language, there are clearly defined rules for how parallelization of execution is done in order for the system to scale. and there are specific tools to control synchronization when needed.
so either we are seeing a BUG in coda that needs fixing OR we are seeing a FEATURE in coda that needs documenting!
The 3 ways i have overcome this Random() number issue in the past is
(1) compute a random string of digits just once using Random() and then use those digits in some clever way to cause pseudo-random behavior inside my FormulaMap() loops
(2) use the last digit of the Created() time-stamp of rows as a kind of random digit. This works when new records are created by users at random times. it fails if a bunch of rows are created by a formula all-at-once (they might all have the same time-stamp)
(3) pre-store a long string of random digits using an external random number generator, and then cycle through that string, grabbing a set of digits as needed.
i really hope a CODA engineer is watching this thread and can comment/document this better.