List values & random value

Hello,

I’m trying to get 1 single random value out column “vision labels”. I consider a single value being word(s) separate by a comma (eg.: “Dish” = 1 value, “Food” = other value). My unsuccessful attempt to achieve this in the 2 following steps:

  1. Converting “visions labels” column into a list format (cfr. column “list of values”).
  2. Isolating 1 single random value in the third column with the following formula: thisRow.list.Nth(Remainder(Random(true) * 1000, thisRow.list.Count()).RoundDown() + 1)

Hello @Jeremy_Corman!
To separate “vision labels” as a list you can use split() formula as follows:

thisRow.[vision labels].Split(",")

image

And the last formula can be simplified as follows

thisRow.[list of values].Nth(RoundUp(Random(true)*thisRow.[list of values].Count(),0))

image

I would recommend making a button with that last formula filling another column, that way, when you want another random value you just press the button. Otherwise the random value updates at every change in the doc.

1 Like

That’s exactly the answer I needed, thanks a lot @Saul_Garcia !

1 Like