Save the date! Join us on October 16 for our Product Ops launch event. Register here.
Jun 15, 2022 03:15 AM
Hi guys, first post for me and i’m french native so sorry for spelling mistakes
I have a base that shows every forms (one record for one form) and I would like to automaticaly fairly attribute a single select choice to each of these forms when they are submited
I have 3 developers and I would like to fairly attribute them a form (ex. I have 90 forms/I would like 30 forms per dev)
Here I’m attributing it manually
Thanks you guys
Solved! Go to Solution.
Jun 15, 2022 06:31 AM
Used “number of records” modulo “number of people” and a simple switch case. I then get the output and update it with basic automation “Update Record” :
let queryResult = await view.selectRecordsAsync({fields: });
let nbRdvPris = queryResult.records.length;
let arrayBizDev = [“Christophe”, “Thomas”, “Hugo”]
let nbBizDev = arrayBizDev.length;
let bizDev;
switch (nbRdvPris % nbBizDev) {
case 0:
bizDev = “Christophe”;
break;
case 1:
bizDev = “Thomas”;
break;
case 2:
bizDev = “Hugo”;
break;
default:
console.log(erreur
);
}
output.set(‘Business Developper’, bizDev);
Jun 15, 2022 06:31 AM
Used “number of records” modulo “number of people” and a simple switch case. I then get the output and update it with basic automation “Update Record” :
let queryResult = await view.selectRecordsAsync({fields: });
let nbRdvPris = queryResult.records.length;
let arrayBizDev = [“Christophe”, “Thomas”, “Hugo”]
let nbBizDev = arrayBizDev.length;
let bizDev;
switch (nbRdvPris % nbBizDev) {
case 0:
bizDev = “Christophe”;
break;
case 1:
bizDev = “Thomas”;
break;
case 2:
bizDev = “Hugo”;
break;
default:
console.log(erreur
);
}
output.set(‘Business Developper’, bizDev);