Hmm, do you have an Airtable Pro plan? Does it matter whether you assign the person to the group that has only had 4 users the longest?
Hmm, do you have an Airtable Pro plan? Does it matter whether you assign the person to the group that has only had 4 users the longest?
Hello,
Thank you for your reply ! Yes I do have a pro plan.
No it does not really matter for the duration, the automation could pick any group that has less than 5
Hello,
Thank you for your reply ! Yes I do have a pro plan.
No it does not really matter for the duration, the automation could pick any group that has less than 5
Roger that. I would suggest:
1. Create a count field in the "Groups" table that displays the number of people linked to the group
2. In the automation that triggers when a new "Person" record gets created, add a "Find Record" action that'll look for all gorups that have <5 people in it
3. Add a "Run script" action with the following code:
const {foundRecords} = input.config()
console.log(foundRecords)
if(foundRecords.length > 0){
output.set("record", foundRecords[0])
}
else{
throw "No groups with less than 5 members"
}
4. Add the input variables on the left so it looks like the following screenshot:

5. Add an "Update record" action that'll update the triggering record's (i.e. the "Person" record) linked field to the "Group" table with the ID from the script step
The script basically pulls the first group from the "Find Record" action if it found any groups that have less than 5 members, and if the "Find Record" action didn't find anything it'll throw an error
If you DM me an invite link I can set it up for you real quick, or we could also do a quick screenshare where I set it up for you too. Best of luck