I am trying to choose random row in a table and then a random column associated with that row and then print that row/column combination.

The following code below does not compile, I am just including it as an example of how I have tried to approach the problem. Actually, the first three lines compile just fine. Anyway, what I have is:

carry out singing:
choose a random row in the Table of Radio Songs;
let N be the title entry;
say "[N]";
choose a random column in the table of radio songs;
say "[random column in the table of radio songs]";

I also tried:

carry out singing:
choose a random row in the Table of Radio Songs;
let N be the title entry;
say "[N]";
choose a random column entry of N;
say "[column entry]";

I canâ€™t figure out how to choose the column associated with the row.

As always, your help is greatly appreciated. My
CREDITS list is consistenly growingâ€¦

Unfortunately, thereâ€™s no way to choose a random column. Columns can have different types, and expressions in I7 always have to have one specific type.

As a workaround, you can put a list in a table column, and choose a random entry from that.

choose a random row in the foo table;
if a random number from 1 to 5 is:
-- 1: decide on the col1 entry;
-- 2: decide on the col2 entry;
-- 3: decide on the col3 entry;
-- 4: decide on the col4 entry;
-- 5: decide on the col5 entry;

As long as all five named columns have the same type, this will work.

Itâ€™s kind of involved. In all honesty, youâ€™re probably better off re-configuring the data structure of your table. Can you describe it (or something analogous to it) here?