Item sort order via API requirements
Feature | |
|---|---|
Documentation draft | complete |
Contents
Overview
Currently, items are sorted in FOLIO based on barcode value; however, this is not always the desired sorting of items, especially on discovery layers for patrons and staff using the OPAC. The desired sort may be on free text values that are not sortable, such as chronology and enumeration.
Use cases:
Display sorted values for patrons and other library staff (such as Reference librarians) on discovery layers
For FOLIO staff users:
For example, we receive a serial publication out of order. The item for volume 10 is created before the item for volume 9, thus the barcode number is smaller and 10 displays before 9. I want to save them displayed in numeric order.
Requirement | Notes | Status | |
|---|---|---|---|
| 1 | Ability to define how items are sorted |
| complete |
| 2 | No deduplication/validation of defined sort order |
| complete |
| 3 | Retain existing default sort order (for existing items), require manual re-sort |
| complete |
| 4 | For newly created items, sort at the bottom of the order |
| complete |
| 5 | Add sort order to RTAC schema response | https://folio-org.atlassian.net/wiki/spaces/FOLIJET/pages/1384120 https://folio-org.atlassian.net/wiki/spaces/FOLIJET/pages/1395735 | complete |
| 6 | Do not need to update sort order on the UI |
| complete |
| 7 | When libraries migrate to FOLIO, retain sort order from previous system |
| complete |
Summary of solution
https://folio-org.atlassian.net/wiki/spaces/SPITFIRE/pages/938082365
There will be a new required numeric field for item sort order in the schema
There will be a new endpoint to set the value of order field
This new field should be exposed on the UI and could be updated via the UI or API
When libraries initially migrate to FOLIO, they will be able to map their sort order numeric values to this new field
For existing items in FOLIO, there will be a background job that needs to be run to populate the new item sort order field with the existing order of the items
For newly created items, setting the item sort order field should be supported via the UI along with the API
If the user inserts a newly created item into the sort order field on the UI, UI will be able to increment the sort order of the succeeding existing items automatically. This would support and future drag and drop functionality, or support entering a numeric value on the item detail record.
If the user inserts a newly created item into the sort order field via API, likely by entering a sort order value that already exists, we will not be able to auto increment succeeding item sort orders and we will not be able to sort the items with duplicate sort orders - the sort amongst these items would be random
Process flows
Note: UI implementation will be in scope of different feature https://folio-org.atlassian.net/browse/UXPROD-1625 .