# Assign tasks to a random person in a group

The Assign task to a person action is the go-to way to assign tasks to users on your team—it’s also great for assigning tasks to everyone in a Catalytic group.

With a few actions, you can use Catalytic to assign tasks to a random person or assign tasks round robin. These are great patterns to turn into custom actions and reuse across your team.

This technique uses random number generation. Check the How to generate a random number article to learn more.

## How to assign a task to a random person in a group This method works by adding row numbers to a table of user names, then using a field formula to generate a random integer in a range, which corresponds to a row in the table of user names.

To begin, store each user in the group in a data table, and add a column for a row ID. In the row ID column, assign a sequential integer to each user’s row—first row is 0, the second row is 1, etc.

Use the field formula `result = Math.floor(Math.random() * x) `, where `x` is the highest number in the table. This generates a random integer between 0 and `x`.

Then use the Tables: Look up data in a column action to return the user’s name from the table based on the random integer.

##### Learn more about this field formula Use the Field: Field Formulas action to generate a random number using Javascript.

Set the Javascript code to calculate fields field to `result = Math.random()` to generate a random decimal between 0 and 1, such as `0.44637348688935763` or `0.8944293544406741`.

## How to assign tasks round robin This process searches a column of dates for the oldest date, then assigns a task to that user. This way a task is always assigned to whichever user has gone the longest without a task.

To begin, store each user in the group in a data table, one row per user. Add a column for the “Last Assigned Date”. Use the Tables: Minimum data in a column action on the Last Assigned Date column to find the oldest date.

Then use the Tables: Look up data in a column action to return the user’s name from the table based on the oldest date. Assign the task to this user. Then, use the Tables: Update a row action to set that users last assigned date to the current date, so they move to the bottom of the list.

We update the Help Center daily, so expect changes soon.

Paste this URL anywhere to link straight to the section.

Need more help?