Automating Patron Import
  • 02 May 2023
  • 3 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Automating Patron Import

  • Dark
    Light
  • PDF

Article summary

If your library uses a Student Information System (SIS) or another type of database that contains patron information, your IT department may be able to automate the process of keeping your library patron information updated with data from the other system.

Intended for Information Technology Professionals

The following information is intended for IT professionals and involves advanced tasks such as scheduling tasks and creating scripts. Surpass Support will be happy to help with any Surpass-specific questions, but we are not able to provide technical support for Windows and other operating sytems.

Overview

If your SIS or other database management system is able to export patron information on a scheduled basis and in a format that can be used by Surpass Cloud, you can use a utility app called Pupload (patron upload) to upload these files into Surpass Cloud. Pupload can be scheduled using the Windows Task Scheduler.

There is a different set-up process for OneRoster

Some SIS use the OneRoster data standard, which can be directly configured and bypasses the directions that follow. If your SIS uses OneRoster, you will instead want to follow the OneRoster configuration directions.

Process

  1. Database system exports records to a file on a schedule.
  2. Pupload runs after database export to upload the file to Surpass Cloud.

Requirements

  • Windows operating system.
  • Database system capable of exporting records on a scheduled basis or has the ability to perform exports scheduled by Windows Task Scheduler.
  • Database system capable of exporting records in either the Surpass Patron Record Import format or a custom Patron Import Template created by Surpass Software specifically for the format used by your database system (contact Surpass Software for more information).
  • An API key from Surpass Cloud. See Settings : Security : API Keys.
  • The Pupload utility (download link below).

PUpload_200.zip

Steps

  1. Create an API key for patron import.

  2. Determine whether you'll be using Surpass Patron Record Import Format or a custom Patron Import Template.

  3. If you're using a custom Patron Import Template, it must already have been installed by Surpass Software and tested with sample data. You'll need the name of the template (e.g. "PIMPORT.DEF"), which is shown on the bottom of the Patrons : Import : Patrons page.

patron-import-automate-pimport

  1. Download the Pupload utility and unzip into a folder on the computer where it will run.

PUpload_100.zip

  1. Create a batch file or Powershell script that does the following:
  • Exports records from your source database system to a file
  • Calls the Pupload utility after the export to upload the file to Surpass Cloud
  1. Use Windows Task Scheduler or a similar utility to schedule the batch file to run on whatever schedule you chose.

Pupload Parameters

The Pupload utility has 3 required parameters and 1 optional parameter.

  • /url: - The URL of your Surpass Cloud system.
  • /file: - The path and name of the file to import. Enclose in quotation marks if the path and/or file name includes spaces.
  • /key: - The API key.
  • /template: The name of the custom patron import template (optional)

Example:
pupload /url:pcs.surpass.cloud /file:MyExportFile.csv /key:71227db1-6511-438a-90fb-0526131a8878 /template:pimport.def

Example Script

Note: The "exportstudents" part of this script is a made-up example. Consult your SIS or other database documentation or support for the correct procedure to export records.

C:\MySis\exportstudents C:\Surpass\MyExportFile
C:\Surpass\pupload /url:pcs.surpass.cloud /file:C:\Surpass\MyExportFile.csv /key:71227db1-6511-438a-90fb-0526131a8878 /template:pimport.def
Tip: Test Your Script before Scheduling

Before adding your script to the task scheduler, test it to make sure the process works smoothly and that there are no errors reported.

Logging

Pupload creates a log file named PuploadResponseLog.csv in your My Documents folder. This CSV file, which can be viewed in Excel and similar apps, includes the following columns:

  • Date and time
  • Target Surpass Cloud URL
  • File to upload
  • Response of the import process

Troubleshooting

If logging shows that there were any errors importing your patron records, test the file by manually importing it from the Patrons : Import : Patrons. It will give you more detailed information about records that fail to import.


Was this article helpful?