How to get random data from airtable

I wanted to create a list view from airtable and when user click it it should generate random item from next coloumn please help me with this

for example:- my list view item is name and when user click’s it, it should generate a random answer forom next coloumn named answer

Do you have multiple columns?
First one is name?

yes my first coloumn name is account second coloumn name is id i wanted to when a user clicks on acoount coloumn it should generate random answer from id coloumn

send airtable database preview

Capture

So first of all get length of column id. There is two ways of getting list length dynamically
1.Storing length of id column to any cell in database.
2.or Getting column then using list of length block by which you can store length to any variable

and then use generate random integer block

in above block you have to set from 1 to length of list or variable where you stored list length

and when random integer is generated you can use it as row number in get cell.

read carefully and try to understand

1 Like

sorry i can’t get you

would you like to send screen?

yes I AM OK WITH IT

ok send ais

CONFIG1_ACCOUNTS.ais (11.5 KB)

it uses external extension so screen is not importing

should i send blocks?

wait for sometime i’ll explain everything in detail by creating new project asap.
till then just try to understand this

2 Likes

hi @Sri_Harsha
where is confusion in this post

1 Like

coloumn 2 data is not same everytime and i don’t know how to use random integer block with spreadsheet

i am gonna tell every portion one by one.
So first of all,
in column 2 and row number 1 you have to store length of list manually mean suppose you have total 70 record and after some day you have added 30 more records then it mean now you have to update value in column 2 and row number 1 to 100(as you have 100 record now)

do you understand it?

yes exactly

thanks buddy finally it worked :pray: :pray: :+1: :+1: :+1:

So now from above post you understood that to store length of list.
now use get cell block to get the cell( where length is stored that is column 2 and row number 1)

now when you got cell store length to any variable(suppose name of that is maxlenghtvalue)
now use random number generator

from 2 to maxlenghtvalue

now you got random integer between 2 and list length
suppose that generated integer is 72(which you stored to variable named ranindex)

now use ranindex as row number in getting new cell data.