Scope: The Donor Names is a monthly task run on the first week of each month, and it checks for purchases made from certain funds that have been donated by library benefactors.  The fund codes and donor names are mapped to 902 fields, which are added to the bibliographic records of the appropriate purchases.  Steps 1, 2 and 3 below, outline both the gathering of that fund/purchase data, and the bulk-loading of the data into the corresponding bibliographic records, respectively.

Contact:   Peter DelaCuadra

Unit: Automation & Metadata Management

New Procedure:  04|01|2024 

Date of next review: 04|01|2025

This was a batch job run by LSTools for Voyager before the migration of Folio. This task had to be reformulated to accommodate the changes Folio had presented us with.

Step 1:

  • In a DBeaver, implement the SQL script donornames.sql
    • Note: in the sql script, under the first SELECT section, there will be two date strings: one for "payment_date_start_date" and the other for "payment_date_end_date"
    • Add beginning and ending dates, using the format “yyyy-mm-dd”   (see below examples), and then run sql script.
      • Examples:
        • If running the report on first week of 8/2023: Enter 2023-07-01 for start date, and 2023-07-31 for end date.
        • If running the report on first week of 01/2024: Enter 2024-01-01 for start date, and 2024-01-31 for the end date.
  • Once you have your correct dates entered in the sql script, proceed to execute the sql script ... it may take awhile to run.
  • After sql script has completed its query, you will need to export data to some local location as a .csv spreadsheet.
  • Now that you have your .csv spreadsheet, dedupe any titles, and remove/delete any rows with inconsistent data.
  • Save your updated and edited .csv spreadsheet. Then copy the column of UUIDs, (without the header), and paste that data into a new .csv spreadsheet, giving it name to your liking.

Step 2:

  • Login to Folio, using the Export App, navigate to where you saved the .csv file with only the UUIDs, and select that file for exportation.
  • Once the exportation process is complete, you should see your file in the log, under the File name column, with a .mrc extension
  • Single click on your file name, and a copy of that MARC file will be downloaded into your Downloads folder.
  • Navigate to your Downloads folder and copy your new MARC file to ~"C:\Users\<your netid>\lts-automation\data\names\"
  • You will also need to copy your edited .csv file, (NOT the one with the UUIDs), to ~"C:\Users\<your netid>\lts-automation\data\names\"

Step 3:

  • Navigate to ~"C:\Users\<your netid>\lts-automation\scripts\donornames.py" – NOTE: You will have to have python installed on your machine for the script to run.
  • Now execute the python script donornames.py, (whether you use the Windows CLI, or VSCode, or some other means, is up to you).
  • You will be prompted for the appropriate CSV metadata file, then the corresponding MARC file, and then you will be asked to enter what you wish to name your output file.
  • Then the script will run. If you run into an error, please seek assistance from one of the Automation & Metadata Management members.
  • If no errors, the output file you named will be in ~"C:\Users\<your netid>\lts-automation\data\names\"
  • Lastly, import your output file into Folio using the Profile name: "Replace instance and bib"


*Also, see Specification Document here: Cleanup: Add Donor Names