Creating an inline variable in Formula

Hi, I’m trying to make a very simple custom datatype that mockaroo can choose randomly from one of the following words:

{“PENDING”, “IN PROGRESS”, “FINISHED”}

So I thought to do this via random number generation:

if x=random(0,2) == 0 then “FINISHED” elseif x == 1 then “PENDING” else “IN PROGRESS” end

However, “PENDING” never appears in the results. I suspect that it has to do with declaring “x=random(0,2)” but the value of x never carried over. Is there a way to do inline variable declarations in formula?

You should simply use the Custom List data type for this.

1 Like