Dynamic cohorts

Administration tools ::: tool_dynamic_cohorts
Maintained by Dmitrii Metelkin, Catalyst IT
Dynamic cohorts plugin allows dynamically add and remove users from cohorts based on configured rules, which themselves are composed of conditions.
Latest release:
1759 sites
771 downloads
55 fans
Current versions available: 2

Dynamic cohorts plugin allows dynamically add and remove users from cohorts based on configured rules, which themselves are composed of conditions.

For users to be added to the cohort specified by a rule, they must match all of rule's conditions (logical operator AND) or any of rule's conditions (logical operator OR).

Built-in conditions

  • Authentication method (Manual, SAML and etc)
  • Cohort fields (if a user is a member of cohort(s) matching specific cohort fields like cohort name, context, custom fields and etc)
  • Cohort membership (if a user is a member of cohort(s)).
  • Course completed (if a user has completed a course).
  • Course not completed (if a user has not completed a course).
  • User created time (time since a user was created).
  • User custom profile fields (text, menu, date and autocomplete types are supported).
  • User enrolment (if a user is enrolled into a course).
  • User last login (time since a user last logged in).
  • User role (if a user has a role in a given context)
  • User standard profile fields (e.g. first name, last name, username, auth method and etc).
  • User interests (tags) (if a user has a specific interest tagged on their profile).

Please see README file for details about the usage and features of this plugin.

Similar plugins

There are similar plugins that can add users to cohorts dynamically based on user profile fields.

However, "Dynamic cohorts" plugin gets this all to the next level as it provides an API for other plugins to implement pretty much any condition that can limit users from mdl_user table by SQL.

Warm thanks

Plugin funded by Murdoch University, Perth, Western Australia

Logo

Screenshots

Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3
Screenshot #4

Contributors

Dmitrii Metelkin (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments

Show comments
  • András Bertalan Kiss
    Mon, 31 Mar 2025, 8:04 PM
    Very good plugin, sadly it cant see the custom profile fields.. can you solve that?
  • Ricardo Caiado
    Mon, 31 Mar 2025, 8:56 PM
    HI, András.

    I am using this plugin and I can see all the custom profile fields.

    Ricardo
  • Monika Jenkins
    Wed, 2 Apr 2025, 5:20 AM

    Is there a plan to maybe add on to this plugin to include other conditions, such as relative expiration dates, with either "inactivate this dynamic rule 2 months from creation/today,". I think many of us are using this wonderful too in conjunction with cohort sync which lacks expiration dates. In our case, we need to be able to have cohorts or rules be individually managed at customer level, not course level, ideally through fixed or relative dates.
  • Dmitrii Metelkin
    Tue, 8 Apr 2025, 7:33 AM
    Hi Monika,
    Please don't hesitate to raise your request in github as we manage all feature requests there. See https://github.com/catalyst/moodle-tool_dynamic_cohorts/issues
  • Estelle Lesperrier
    Mon, 7 July 2025, 6:07 PM
    Thanks a lot for this plugin. Is there a limited number of conditions I can add within one rule?
  • Shan Lin
    Wed, 30 July 2025, 3:03 PM
    Hi there Dmitrii,
    Will this plugin work in allowing users who self-register using using an email with certain pre-vetted domains (for example @businessname.com) to be automatically added to a cohort? The goal is to avoid manual assignment of users from a list of organisations to certain cohorts.
  • Al
    Thu, 7 Aug 2025, 4:45 AM
    Hi
    I hope you are well, it's been ages. Dynamic Cohort appears to work on Moodle 5. Could you update the supported extension on your end to Moodle 5 so that it installs automatically each week when we update our Moodle instance? It saves us so much time. Cheers.
  • Chris Canning
    Fri, 15 Aug 2025, 8:46 PM
    Hi,

    Does this cohort plugin have conditions for you to omit users when their accounts have been suspended?
  • Christian Grauer
    Mon, 8 Sept 2025, 1:27 AM
    Hi, i'd like to use custom profile fields for some conditions, but they are not listed in the select box. Shouldn't they?
  • Hanna Kubrak
    Wed, 17 Sept 2025, 9:51 PM
    Hi everyone,

    This is an absolutely brilliant plugin! Many thanks to the contributors!

    I'm wondering if there's a technical or practical limit to how many conditions can be combined with 'OR' in a single rule. I want to include users whose email address ends with one of over 50 different domains.
    Would it be better to split this into multiple rules, each with fewer conditions?

    Thanks in advance,
    Hanna
  • Céline Deswarte
    Mon, 22 Sept 2025, 4:44 PM
    Hello,
    I need help setting up the Excel spreadsheet in CSV format, please.
    I can't filter by cohort custom fields.
    I need to be able to register users according to their institution, department, and function.
    The Excel column headings are lastname, firstname, username, email, password, cohort (for the institution), profile_field_function, profile_field_service.
    Can you point me to my errors?
    Thank you for your help.
    Céline
  • Iago París Fernández
    Sat, 18 Oct 2025, 4:06 PM
    Hello

    I can't install the Moodle 4.1 version. It raises an "Exception - Class "ZipArchive" not found" error
  • Magalí Lescano Correa
    Mon, 26 Jan 2026, 11:19 PM
    Hello,

    Thank you for the plugin, it is very helpful.

    I’m having an issue with Dynamic Cohorts on Moodle 4.5.4+ (Build: 20250516) using plugin version 2025102000.

    When I go to Manage rules and click “Add a new rule”, I get a 404 Not Found error.

    I’ve already opened an issue in the bug tracker with more details.

    Could you please help me?

    Thank you.
  • Andrea Briganti
    Thu, 19 Feb 2026, 10:02 PM
    Hello, I just installed the plugin on a Moodle 5.0.3+. Creating a rule via custom profile field is not possible. The list of additional fields is not visible. Only the field Firstname is available. Can you pls help? Thanks Andres
  • Form SSE
    Fri, 6 Mar 2026, 5:17 PM
    Hello Andrea,
    i don't know if you are in a similar config as one of our platforms (running on 4.5.10): only 5 types of custom fileds are handled : text, menu, autocomplete, checkbox, datetime.
    Just after installation i tried the plugin and don't have any possible fields in custom profile field of the allowed type. After addding possible fields it works well.

    Just a comment to developers: should it be possible to mix AND /OR conditions (shouldbe more complex to handled but nice to have!)

    Thanks
1 2
Please login to post comments