Re: Random values from another column?

522 0
Showing results for 
Search instead for 
Did you mean: 
4 - Data Explorer
4 - Data Explorer

Is there a way to set column 2’s values to be a random value from Column 1?

Let’s say I have 5 records. There are 5 values in Column 1. I would like to pick a random value from Column 1 and set that as a value for each record on Column 2.

1 Reply 1

Welcome to the community, @arunsathiya! :grinning_face_with_big_eyes: Before diving too deeply into my main answer, I want to make sure I understand your goal. Using your five-record example, let’s say that the values in {Column 1} are 1, 2, 3, 4, 5. The way you described your desired setup, it sounds like you want to pick a single value from {Column 1} and fill all of {Column 2} with it. So if the number 3 was chosen randomly from {Column 1}, {Column 2} would end up being 3, 3, 3, 3, 3. Is that correct?

The problem with any kind of random selection is that Airtable currently doesn’t have any randomization features. I’ve heard of one user building a complex substitution system that uses the record ID to create a pseudo-random selection, but that all operates within a single record. Your request is trickier because you want this to happen across multiple records. Because Airtable is a database and not a spreadsheet, records have no intrinsic knowledge of each other. There are ways to hack cross-record calculations, but they’re definitely hacks, and not always the optimal solution. You will probably need to look into an API-driven solution to achieve what you want.

However, part of me is trying to understand the underlying data design you’re working with, and why you’d want a single random value from one field to completely fill another field. Could you describe your setup in greater detail? Something tells me there’s a way to improve the design of your base, even if it doesn’t necessarily address the randomization you seek.