Is it possible to export a student list to a spreadsheet with group information in it?
What Kona meant when she said "no" is "not through the web interface" or "not easily". Another way to look at it is "How badly do you want it?" If you have small classes, it may be easier just to get the information from the People pages where the groups are listed. If have a large class with lots of groups, it may be worth your time to continue.
That said, there are a lot of things that can be done through the API that can't be done through the web interface.
There are some group-related reports that may be useful that we can get from the API and although the API generates JSON and not a spreadsheet, there are online converters that will convert your JSON into a tab-delimited format that you can then copy/paste into Excel or Google Sheets.
Some definitions before we start may help
Each of the three :id's need replaced by actual numbers in the API calls.
This is a multipart process, but may be shortened depending on how complex your group structure is.
The basic flow is like this:
Note that there is an API call that will generate a list of all users for group categories, but it doesn't say which individual groups they belong to and for me, at least, turned out to just be a list of people in the class, even though not all of them were in a group (but because they had all submitted assignments that were part of that group category).
You need to use the Group Categories API to do this. There is an endpoint called List group categories for a context that you will need to use:
Hint: If you have more than 10 group categories in your course, add ?per_page=100 to the end of that query to get up to 100 of them at a time and hopefully avoid pagination, which opens another level of complexity to the process, so it's best avoided.
The important fields returned are the id, which is really the :group_category_id that you will need in the next step, and the name, which is what you called the group Category.
Use the name to choose the group category you want the groups for.
There are a couple of ways to go about this, probably the most forward is sticking with the Group Categories API, but this time using the List groups in group category endpoint.
You need to replace the :group_category_id with the id found in step 1.
Hint: The same note about ?per_page=100 from step 1 applies here and to all GET statements.
This will give you a list of all the groups that belong to a particular group category.
The important information to take away from this is the id, which is actually the :group_id that you will need for the next step.
To do this, we will need the Groups API and the List group's users endpoint.
You will need to iterate over all of the :group_id values found in step 2 to get the entire list of group membership.
This will give you a list of the users within each group. In particular, it will return the name of each student in the group. It also returns other things like sis_user_id and sis_login_id if you want it.
There are other API calls here, one is called Get a Group Membership, but it only returns the Canvas user id's for the members and not their names or login_ids. If you only have one group category in the course, then you can use the List the groups available in a context endpoint and cut out the stuff with the group categories. You'll still need to iterate over each group to get a list of the students in it.
It turns out that everything that I've done here can be done without writing a line of code, but it will take additional work.
You can make API GET calls (which everything here is) without getting a Token and then messing with the code.
You can append the GET statements above to your main Canvas instance.
For example, let's say that you're logged into your course and sitting on the main page and the URL is
Then the 123 is your :course_id
Change the URL to
and then hit enter.
You'll get the JSON code. There may be an extra
at the beginning of the code. That is not part of the data and when you copy/paste it into a converter, make sure you don't copy that part.
If your comfortable obtaining an authorization token, then there is a menu-driven interface to all of this. Point your browser to
Enter your token at the top. Then scroll down until you find the Group Categories and Group sections. Expand the one you want, choose the appropriate API call, and enter your information.
Note that this doesn't take advantage of the per_page=100 because it's mainly for testing to see what would happen, but it does give the URL it called and you can manually append it.
Now moving on to the final part of the puzzle. You said you wanted this in a spreadsheet and the API calls return JSON.
There is a JSON to CSV converter that I found online (with Google's help).
You paste the JSON from your browser (make sure you don't copy the while(1); part) into the box.
For settings, I recommend using an Output Field Separator of a Tab (also known as tab delimited) so that you can copy/paste directly into a spreadsheet. The first time you paste the results, you'll probably want to include header's in the first row, but if you're copying additional group users, for example, you don't want the headings.
Then click Convert JSON to CSV. You will get a textbox that you can highlight and then copy/paste into a spreadsheet.You will also get an HTML table of the information below that so you can see what it looks like.
If you are really good friends with your Canvas admin (or happen to be him), then you can generate a report that will list group membership.
Go to Account >> Settings >> Reports >> Provisioning and click Configure.
Tell it that you want Group CSV, the Group Membership CSV, and the Users CSV. You'll probably want to limit it to the current term.
While this fetches all of the data, you still have to do some collating of it. The Groups CSV file contains the group names and IDs, the Group Membership CSV contains the group memberships, but only using the Canvas user IDs, which is why you need the User CSV to convert those into names.
If you have programming skills or know a programmer, you can automate the entire process. I've done that for a project where I need a list of all the group memberships so I can randomly assign peer reviews (Canvas' built-in randomizer is not sufficient for my needs).
That is beyond the scope of this message.
As Kona said, you can always put in a feature request. Those can take a while and may never come to pass.
If you are not technically minded and can't find someone who is, or if you have a small class, it's probably easier just to do it by hand for right now.
Chun, unfortunately no, there is no way to do this. There is a feature idea - Printable course roster - that is slightly similar to what you are looking for. It's for a printable course roster (and something for groups), so not exactly, but similar. If you don't think this is close enough you can create a new The specified item was not found. for your specific need.
This idea is similar, too: Allow CSV export of data from Student Groups
I too would like to see this functionality, to export a group set as a csv, with the touch of a button. I can't even seem to find a way to search for a student within a group set (for instance, if John Smith asks me which group he's in, I have to check all of my 66 groups manually to find him.)
Retrieving data ...