Apr 21, 2022 02:56 PM
Hello everyone! Thank you for taking the time to review my question.
I am using the Airtable “Find Record” automation feature to find records based on certain conditions. Once the feature finds multiple records, it selects the “Top” or “First” record that meets the condition criteria. I am trying to have it randomly select from the results, rather than default selecting the same record that was on top or first. Does anyone know the direction to look in or the process to make this possible?
Thank you kindly in advance!
Solved! Go to Solution.
Apr 22, 2022 07:06 AM
Welcome to the community, @Jonathon! :grinning_face_with_big_eyes: Without using scripting, there’s no way to make a random selection from a collection of records. If your base is in a Pro-plan workspace or higher, you can use scripting actions in automations, and this would be doable with the help of JavaScript’s Math.random()
method.
Apr 22, 2022 07:06 AM
Welcome to the community, @Jonathon! :grinning_face_with_big_eyes: Without using scripting, there’s no way to make a random selection from a collection of records. If your base is in a Pro-plan workspace or higher, you can use scripting actions in automations, and this would be doable with the help of JavaScript’s Math.random()
method.
Apr 22, 2022 08:07 AM
Thank you! I am going to pursue that route and hopefully find success! I really appreciate your response
Apr 22, 2022 11:04 AM
Welcome to the Airtable community!
What technique are you using to select the first record from the find results?
There are techniques for getting pseudo-random values by doing things like looking at the record ID, created time, or last modified time of a record. However, in this case, I believe that a scripting solution is probably best.
Apr 22, 2022 12:35 PM
Thank you so much for your feedback! Right now, the results are sorted by I.D. number, but I am trying to have the results randomly selected with no value being a determining factor for selection (Other than the conditions it uses to narrow the selection.) I am looking into running a script today.
Thank you again for providing your information!
May 01, 2023 07:16 AM
Does anyone have a code sample to use that would achieve the result? This is something Im also interested in.