Bulk Merge Users Using Google Sheets

kyle_cole
Instructure
Instructure
0
512

IMPORTANT DISCLAIMER: This is a homemade solution and is not Instructure supported. 

Hello! 

A common thing I hear get asked is, "How do I bulk merge users?". At this time, we can go into the Canvas UI and merge them manually or use the API endpoint. Well, what if there are more than a couple, and you don't know how to make an API call? You would be stuck manually merging those users, so I decided to create an easier way. In this Google Sheet, you will list the Canvas ID, and the Destination Canvas ID press merge users, and the combination of Google Apps Script and the Canvas API will do the work. You also have the option to merge users across accounts if you are in trust and unmerge users in bulk as well. 

What you will need:

You will need the following items to make this Google Sheet work:

  • Your .instructure URL. For example, canvas.instructure.com. You can find your Instructure URL in your admin settings under Canvas Cloud Information. You could use your vanity URL, but the best practice is to use your Instructure URL for API calls. 
  • An API token with the appropriate permissions. You can generate an API token by following this guide:  How do I manage API access tokens as an admin? - Instructure Community If you have the ability to merge users in Canvas, your API token will be able to merge users as well.
  • The Canvas ID of the users you would like to merge. You can grab the Canvas ID at the top of the user's Canvas profile URL. For example, https://canvas.instructure.com/accounts/584/users/20761, 20761 would be the Canvas ID. Or you can run a Users Provisioning Report, and the Canvas ID will be the first column of that report. You can run a Users Provisioning Report in the Admin Reports part of Canvas.
  • If you are merging users across trusted accounts, you will need to know the domain of the destination Canvas ID. For example, canvas.instrucuture.com. 

 

How to use:

 

 

Possible Issues:

It is highly unlikely you will run into these, but just in case:

  • Google has a rate limit of 300 requests per minute. If you run over that, it will error out. Based on some testing and napkin math, you shouldn't hit this, but if you do, remove the successful merges and restart the process with the failed merges.
  • Google also has a per-day limit based on your subscription. If you run into that, you will have to wait it out. 

 

Lastly, here is the link to the sheet and the code used to make this happen. If you have any questions or run into any issues, post in the comments below. 

Link to Google Sheet: https://docs.google.com/spreadsheets/d/16VGIQKr0qhiJGyzNyEZ1GKaZBXIi1dLvdq-JH63iD3Y/copy

Link to the Google Apps Script: https://github.com/KyleCole90/Canvas-Scripts/blob/main/Apps%20Scripts/Bulk%20Merge%20Users.gs