Your Community is getting an upgrade!
Read about our partnership with Higher Logic and how we will build the next generation of the Instructure Community.
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.
Solved! Go to Solution.
@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).
and in Firefox (the console prompt is at the bottom -- make sure "Logging" is highlighted)
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.
My colleague found a much easier way to export student email addresses from Canvas. You can export them right from Analytics Beta.
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
@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).
and in Firefox (the console prompt is at the bottom -- make sure "Logging" is highlighted)
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.
What, what!!! This is pretty slick and I feel like I have a new tool in my arsenal!
I just get their names
This script is great, but I wanted to be able to bypass the need to open up the console. I tweaked the code a bit to work as a bookmarklet and to output the same data into a prompt box, where it can then be copied and pasted elsewhere.
You just need to create a browser bookmark, with the below code as the "URL". Click the bookmark when you are on the Home or People page of a course, and the same data will pop up in a prompt, already highlighted. Copy the highlighted text with CTRL+C, and paste wherever you need it to go. You can click "Okay" or "Cancel" to dismiss.
javascript: (() => { var url = '/api/v1/courses/' + (typeof ENV.COURSE !== 'undefined' ? ENV.COURSE.id : ENV.course.id) + %27/users%27;$.getJSON(url, %27per_page=100&include[]=email%27, function(d) { prompt("Text below can be copied using CTRL+C", d.map(function(e) { return [ %27name%27, %27login_id%27, %27email%27 ].map(function(f) { return e[f]; }).join(%27\t%27); }).join(%27\n%27));});})();
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).
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.
My colleague found a much easier way to export student email addresses from Canvas. You can export them right from Analytics Beta.
solved? not for most faculty..
We need a simple student export from People...
Last Name. First Name. email. Student ID
Thanks
This might not be a fast solution (especially if you are wanting e-mail addresses from multiple courses), but you can download an attendance report from any course via New Analytics. It's a CSV file that will give you the student name, e-mail address, and ID number. Here's a Guide with more information:
How do I view and download reports in New Analytic... - Instructure Community (canvaslms.com)
Look for the "Class Roster" report, and run it to get a CSV file for the course.
Here's a question: How do I get the students' first names and last names in separate columns? It looks like all of these options just return the Full Name in one field. Any suggestions?
I just paste into Excel, where you can use the "Text to Columns" feature (found on the Data tab).
This script is useful, however, I am trying to get email address (and names) from an email sent to students and caregivers. Is there a way to export those names? (Canvas isn't the only means by which we contact home, but I love the "Message Students Who" function and want to use the program to message in other applications). Thx!
To interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign InTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign In
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.