Tuesday, December 17, 2013

Alma: Batch Patron Delete

This past summer we migrated from Innovative Interfaces (III) to ExLibris' Alma system. III had some great batch delete options for patron records. However with Alma those tools do not yet exist, we needed some way to batch delete a number of patron records.

It got me to thinking, what if I read an excel file of barcodes of patrons which we want to delete, and basically sent a deleteUser call based on the userID to the Alma user web service.

Below are the steps we used:

  1. First we installed PHPExcel 1.7.9. This lets us easily read through the spreadsheet.
  2. Using Alma Analytics we created a spreadsheet of the users that we wanted to delete.
  3. Next we set up a file to make the call to the UserWebServices wsdl.
  4. There are a number of functions available on from the web service and one is "deleteUser".
  5. So we basically read through the excel file and delete each patron record. If success, we report back the ID that was deleted. If the delete fails, books on loan, patron has fines, or the user id no longer exists the report lets you know who it could not delete and the reason why it failed.

    Here is a sample of the report:

    UserID 2044325 HAS been deleted
    UserID 2045274 HAS been deleted
    UserID 2046383 HAS been deleted
    UserID 2046389 HAS been deleted
    UserID 2046625 HAS been deleted
    UserID 2046757 HAS been deleted
    UserID 2046897 Could not be deleted because User not found
    UserID 2046918 Could not be deleted because User not found
    UserID 2048022 HAS been deleted
    UserID 2048028 Could not be deleted because User not found
    UserID 2048220 Could not be deleted because User not found
    UserID 2049102 Could not be deleted because User not found
    UserID 2049493 Could not be deleted because User not found
    UserID 2058282 Could not be deleted because User not found
    UserID 1694234 Could not be deleted because User not found
    UserID 1856181 Could not be deleted because User not found
    UserID 2114672 Could not be deleted because User not found
    944 Patrons records handled.    


No comments:

Post a Comment