Koha How-To

Koha Question of the Week: How Do We Remove a Patron Attribute If Accounts Are Using It?

Each Friday, we will bring you a new Koha Question of the Week. We will select real questions that we receive and share the answers with you!

Question: How Do We Remove a Patron Attribute If Accounts Are Using It?

Answer: Patron attributes cannot be deleted if there are accounts using them, so libraries will need to clear that attribute from accounts in order to delete the attribute.

Luckily, reports combined with batch patron modification make it easy to identify accounts using an attribute. The Koha reports wiki has some sample reports for identifying accounts using an attribute as well as identifying accounts using a particular value in an attribute. The former, identifying accounts using an attribute by code, will be how to identify patrons with any value in that attribute if libraries are looking to remove an attribute all together. The sample report can be copied into a library's reports library.

A screen shot of various patron attributes, with a notice above them that the patron attribute "ROP" could not be deleted because it was in use in three records.

For our example, this library has decided that retaining information on whether patrons have a ring of power (patron attribute code: ROP) is personal information and should no longer be stored in Koha. Running the report with the runtime parameter of ROP will return the three accounts using that attribute. Because the report includes a column with card numbers, batch actions can be performed on all visible results returned in the report, meaning that a library can modify up to 1000 patron records in one batch. (The same functionality exists if the report returns a column with the borrowernumber.)

Patron attributes appear at the bottom of the batch patron modifier tool. Libraries can select the attribute to act on, whether that is clearing all values from existing attributes for attribute deletion or entering a new value in that field. Selecting the checkbox next to the attribute description will clear all data in that field. If libraries are really cleaning house with old data, they can select multiple patron attributes to clear using the 'New +' option to the right of the attribute.

Once the all accounts using an attribute are cleared, the attribute can be deleted in Administration ->Patron Attribute Types.

Additional Resources

Monday Minutes: Patron Lists & Modification

Monday Minutes: Patron Attributes