# WRLC - Retention Copy Analysis Tool

At a glance

- **Status:** Active
- **Environment / Tags:** Analytics
- **Applies consortium-wide?:** Yes (Inferred)
- **Runs on:** Alma Network Zone (NZ) (Inferred)
- **Trigger:** Manual web form—runs when a user submits a barcode
- **Primary outcome:** Displays all copies of a title (same Network ID) along with retention and processing details
- **Who receives results:** The user who submitted the form (interactive display in browser)

---

## Why this exists

When evaluating retention commitments across the consortium, staff need to understand how many copies of a title exist and which institution is responsible for retaining them.

This workflow provides a quick way to analyze all copies tied to the same **Network ID** (i.e., the same bibliographic record or edition). It helps staff:

- Identify which institution has committed to retain a title
- Review retention decisions before making changes
- Understand duplication across partner libraries
- Support retention reassignment workflows

---

## What it does

- Presents a web form asking the user to enter a **barcode**
- Uses the barcode to look up the associated item in Alma Analytics
- Extracts the **Network ID** (shared bibliographic identifier) for that item
- Uses the Network ID to retrieve **all matching copies** across the consortium
- Pulls detailed data for each copy, including: 
    - Title
    - Barcode
    - Process type (e.g., item status)
    - Retention commitment status
    - Retention reason
    - Call number
    - Fulfillment note
    - Institution name
- Formats results into a table for easy review
- Displays the results directly in the browser
- Shows an error message if no valid Network ID is found

---

## Where it runs

- **Alma IZ(s):**
    - Network Zone (NZ)
- **Systems touched:**
    - Alma Analytics (reporting system used to query library data)
    - n8n web form interface
- **Reports / queries used:**
    - `/shared/Washington Research Library Consortium (WRLC) Network/Reports/CannedReports`
        - *Retention Reassignment Form - Barcode Lookup*
        - *Retention Reassignment Form*

---

## How it works

### Logic overview

1. User submits a barcode via the form
2. Workflow runs **Barcode Lookup** report to retrieve item data
3. Extracts the **Network ID** from the result
4. Runs a second Analytics query using that Network ID to find all related copies
5. Branches based on whether the Network ID lookup succeeds

---

### If results exist

- All matching copies (same Network ID) are displayed in a table
- Each row includes: 
    - Title
    - Barcode
    - Process type
    - Retention commitment (Yes/No)
    - Retention reason
    - Call number
    - Fulfillment note
    - Owning institution
- A total result count is shown at the top

---

### If no results

- If the Network ID cannot be found or is invalid: 
    - User sees an error message:
        
        > “Your item does not appear to have a valid network ID. You may need to do a more detailed search in Alma.”
- If no matching copies are returned: 
    - The table displays:  
        **“No results found.”**

---

### Artifacts produced

- **No files generated**
- Output is a **dynamic HTML results page** displayed immediately to the user
- Includes a restart option to run another search