Flat File Enrollment and Groups

Picture of Ryan Sullivan
Flat File Enrollment and Groups


I'm trying to figure out how to use flat file enrollment and also include students in groups in their courses. We're currently using Moodle 3.3. I'm currently using the flat file enrollment sync scheduled task to manage students. 

Teachers are wanting their students grouped based on the hour they are enrolled in. I can get the information from our student information system - I just need to figure out how to get that into the flat file in a way Moodle can read it and act appropriately. 

Currently, our flat file looks like this:


Can I somehow append the group to this in a way that is readable? Or should I use a different enrollment method?

Thanks for any info provided

Average of ratings: -
John Provasnik at Moodle Moot US
Re: Flat File Enrollment and Groups
Particularly helpful Moodlers

I too am looking for a way to add groups through Flat File (because Flat File alerts teachers of the course of the new enrollments). I don't believe it's possible to enroll in groups through Flat File method. 

CSV Upload (directly through the Moodle interface) allows for enrollment into groups or cohorts.

Average of ratings: -
Picture of Sara Arjona Téllez
Re: Flat File Enrollment and Groups
Core developersPlugin developersTesters

Hello Ryan and John!

At the moment, as you suspect, it's not possible to specify the group in the flat file enrollment.

I just created a tracker issue and I'm just noting the number here - MDL-60800. In the meantime feel free to help us work on this issue. If you are able to provide a patch or links to your Git repository branch, please let us know, adding the "patch" label to the issue, so we will spot it. 

Please, don't forget to watch the issue to get updates wink

Average of ratings: Useful (2)
Re: Flat File Enrollment and Groups

If "groups" cannot be created using Flat File Enrollment ... an alternative may be Site Admin > Bulk User Actions > Upload Users (via csv).

  • We have used Bulk user upload CSVs to create user accounts; enrol into courses and add to groups as needed.
  • Another alternative plugin that allows teachers to bulk enrol and add groups is the CSV Enrol and Groups https://moodle.org/plugins/local_userenrols


Average of ratings: -
Picture of Emma Richardson
Re: Flat File Enrollment and Groups
Documentation writersParticularly helpful Moodlers

If you could map that field to the Institution field or something similar you could use the auto group plugin to automatically group them.  I am attaching the latest version which is working correctly through version 3.4.  The one in the plugins database is an older version.  I have asked the developer to upload the last version but I have it so have included it.

Average of ratings: -