cancel
Showing results for 
Search instead for 
Did you mean: 
cbobb
Community Member

Export Student Email

Jump to solution

Is there a way to export student email addresses that are stored in Canvas? I need to create accounts for my students in another program and would like to use the email address that they currently have stored in Canvas as their primary email address. It seems this should be easy to pull from people, but I do not see the option for it.

1 Solution

Accepted Solutions
James
Navigator

 @cbobb ,

 

Here is some non-intelligent code to get your list. By non-intelligent, I mean it won't handle more than 100 students without modification and it doesn't distinguish teachers from students. But it's quick and it's relatively easy to use, which is what I was after here.

var url = '/api/v1/courses/' + (typeof ENV.COURSE !== 'undefined' ? ENV.COURSE.id : ENV.course.id) + '/users';
$.getJSON(url, 'per_page=100&include[]=email', function(d) {
  console.log(d.map(function(e) {
    return [ 'name', 'login_id', 'email' ].map(function(f) {
      return e[f];
    }).join('\t');
  }).join('\n'));
});‍‍‍‍‍‍‍‍

To use it, navigate to your course main page (or the People page). The ENV.course.id contains the course ID when you're on the People page. If you're on the main page, then it's under ENV.COURSE.id or ENV.COURSE_ID or ENV.course_id, but not ENV.course.id. The script checks for the existence of ENV.COURSE and if it doesn't exist tries ENV.course but (non-intelligently) doesn't verify its existence.

Open the console on your browser. This is also called Developer Tools. Normally that's F12 and then look for Console. I've tested this in Firefox and Chrome on a PC, but it should also work fine on a Mac and in Safari.

Paste the contents of the script into the browser window and press Enter.

Here's what it looks like in Chrome (the console prompt is near the top -- the options don't matter).

245708_pastedImage_1.png

and in Firefox (the console prompt is at the bottom -- make sure "Logging" is highlighted)

245709_pastedImage_2.png

What you'll get is a tab-separated list of user names, their login IDs, and their email addresses. You can highlight and copy/paste this into a spreadsheet or other application.

The script doesn't check for the existence of any of those fields (non-intelligent), so it might throw errors if they don't exist.

The items returned can be modified by changing line 4 of the code. Available choices may include (depending on your level of permissions): email, id (Canvas ID), integration_id, login_id, name (First Last), short_name, sis_import_id, sis_login_id, sis_user_id, sortable_name (Last, First)

The amount of the output that I can show is so heavily redacted because of FERPA that it borders on useless. However, you can see my line as well as someone someone who had replaced their school-issued email with a Gmail address.

245710_pastedImage_4.png

View solution in original post

6 Replies
Brian_Renshaw
Learner

What I've done in the past is export the Gradebook to a CSV file. For us, the SIS Login ID is the username, which is the first part of the email address (Ex. student123 = student123@students.sbts.edu). Once I have that information I just use the append formula in Excel to append the url portion to the ID (Append same text to every cell in a column in Excel - Stack Overflow

Another way, not directly through Canvas and especially if you are wanting unique email's that the students are using is to create a Google Form and embed it in a page (Embedding a Google Form on a Public Website - YouTube) and require students to put their name and preferred email address. This will create you a nice Google Sheet with all the information you want.

Probably not exactly what you're looking for but I'm not sure if there is a direct way through Canvas. Hope that helps

James
Navigator

 @cbobb ,

 

Here is some non-intelligent code to get your list. By non-intelligent, I mean it won't handle more than 100 students without modification and it doesn't distinguish teachers from students. But it's quick and it's relatively easy to use, which is what I was after here.

var url = '/api/v1/courses/' + (typeof ENV.COURSE !== 'undefined' ? ENV.COURSE.id : ENV.course.id) + '/users';
$.getJSON(url, 'per_page=100&include[]=email', function(d) {
  console.log(d.map(function(e) {
    return [ 'name', 'login_id', 'email' ].map(function(f) {
      return e[f];
    }).join('\t');
  }).join('\n'));
});‍‍‍‍‍‍‍‍

To use it, navigate to your course main page (or the People page). The ENV.course.id contains the course ID when you're on the People page. If you're on the main page, then it's under ENV.COURSE.id or ENV.COURSE_ID or ENV.course_id, but not ENV.course.id. The script checks for the existence of ENV.COURSE and if it doesn't exist tries ENV.course but (non-intelligently) doesn't verify its existence.

Open the console on your browser. This is also called Developer Tools. Normally that's F12 and then look for Console. I've tested this in Firefox and Chrome on a PC, but it should also work fine on a Mac and in Safari.

Paste the contents of the script into the browser window and press Enter.

Here's what it looks like in Chrome (the console prompt is near the top -- the options don't matter).

245708_pastedImage_1.png

and in Firefox (the console prompt is at the bottom -- make sure "Logging" is highlighted)

245709_pastedImage_2.png

What you'll get is a tab-separated list of user names, their login IDs, and their email addresses. You can highlight and copy/paste this into a spreadsheet or other application.

The script doesn't check for the existence of any of those fields (non-intelligent), so it might throw errors if they don't exist.

The items returned can be modified by changing line 4 of the code. Available choices may include (depending on your level of permissions): email, id (Canvas ID), integration_id, login_id, name (First Last), short_name, sis_import_id, sis_login_id, sis_user_id, sortable_name (Last, First)

The amount of the output that I can show is so heavily redacted because of FERPA that it borders on useless. However, you can see my line as well as someone someone who had replaced their school-issued email with a Gmail address.

245710_pastedImage_4.png

View solution in original post

What, what!!! This is pretty slick and I feel like I have a new tool in my arsenal!

James
Navigator

Here's another way to get the results. It uses the same API call I mentioned in the other one, but takes the programming out of it.

Browse to your People page for your course. Edit the location (URL) at the top to 1) add /api/v1 before the /courses and 2) add ?per_page=100&include[]=email at the end. You can leave off the per_page if you have 10 or fewer students.

Here is an original and modified location:

https://richland.instructure.com/courses/2151246/users
https://richland.instructure.com/api/v1/courses/2151246/users?per_page=100&include[]=email

When you press Enter, you'll (hopefully) get a line of JSON that will probably start with a while(1);


Select everything after the while(1); beginning with (and including) the left bracket [ and all the way through the ending right bracket ]. Do not include the while(1); in what you copy/paste.

Then copy that to the clipboard.


Go to a website that converts JSON into CSV (Excel). There are many available; here are a couple (no endorsement intended).

  • json-csv.com. Click on the Cog and choose Tab as a delimiter so you can copy/paste the results back. Otherwise you can download it as a CSV file and open that with a spreadsheet.
  • convertcsv.com. In step 1, choose option 3 to paste your data. In step 2, you can change the separator to a tab if you want to copy/paste, or leave it alone to download a file. In step 3, choose JSON to CSV to get it in a textbox you can copy/paste or choose JSON to Excel to download it directly.

These options will give you all of the information available, not just the fields you want, but then you can pick and choose what you want.

In both cases (this message and the first one I posted), if you have more than 100 students, you'll need to add a &page=2 at the end of the query parameter and re-run it to get the next 100 students. If you have more than 200 students, then repeat with &page=3 and so on until the entire list is obtained.

hendryxj
Community Member

My colleague found a much easier way to export student email addresses from Canvas. You can export them right from Analytics Beta.

322966_Analytics Email.jpg

jnilebarnes
Surveyor

solved? not for most faculty..

We need a simple student export from People...

Last Name.    First Name.     email.      Student ID

 

 

Thanks