Create Lists - Importing Barcodes

This process works best when combined with the attached Word document.

To create a review file from a list of barcodes (Sierra 2.2 and above), the users can do this by using the JSON feature in Create Lists. Unfortunately, it is more complicated than using the "Import Records" button added in Sierra 2.1. "Import Records" only works for lists of record numbers. It does not work for barcodes.

Note: This query searches barcode field data, NOT normalized index entry data. Therefore, if the barcode is saved in the record with white spaces like "3 5006 00125 7233" or " 35006001257233 ", it must be entered into the query exactly as it is stored in the record. Leading or trailing white spaces, white spaces added inadvertently within a string of barcode numbers, and so forth may cause records to be difficult to find.

Important: The barcodes must be formatted in the list so that all are enclosed by quotation marks, and all but the last are followed by a comma outside of the quotation marks.

"1234567891013" NO COMMA ON LAST LINE

Here is how to use Notepad ++ to create a review file starting with a list of barcodes using Notepad++.


Here are the steps to scan barcodes into Notepad++, and add the needed formatting to work in JSON.

  1. Scan your barcodes into Notepad++.
  2. Press Ctlr F.  This will bring up the Replace Box. 
    a.Click on Regular expression
    b.Click Replace
    c.Find what: ^(.*)$ - use the 6 key for the ^
    d.Replace with: "\1",
    e.Click Replace All
  3. You should get a message at the bottom of the screen letting you know how many items were processed.
  4. You need to do a little cleanup with the barcodes.  You will need to remove the , at the end of the last barcode.

Create Lists in Sierra

  1. Find an empty review file that has the Max Records that will hold all your scanned barcodes from Notepad++. 
  2. Click on "Search Records" to open the review file.
  3. Change the Store Record Type value to the type of record that your barcodes matches (usually item or patron records).
  4. Change search type from default Classic to JSON.
  5. Remove any text in the query box (usually just a pair of curly braces, '{ }').
  6. Make sure to name your review file using your libraries two or three letter identifying code.
  7. Paste the formula from the attached Word document (located at the bottom of this page) into review file for the JSON query using Ctrl V.  Make sure to include your formatted barcodes.  This formula is for item records. For patron records (or other records that have indexed barcodes), change the line "type": "item" and change it to "patron" or whatever record type is appropriate.

Possible problems

Bad Data in your query:

If you see the error message, "Unterminated array at line xx column xx", you may have a stray character in your query that is tripping up Create Lists. For example, if you have a list containing thousands of barcodes, you may not have visually inspected every line, and could have a line with a character or a string of characters not contained inside the quotation marks. The Create List error message will tell you the line number of the problematic line in the query ("Unterminated array at line xxx...), and if you are using a text editor like Notepad++ that displays line numbers, you should be able to find such lines quickly.

"0538505744416",7 <---------Stray character "7" should not be present

Bad Data in your records:
If you barcode data is stored in patron and item records with inconsistent formatting or extra whitespaces, punctuation, etc., you might have trouble finding a given record.

For example, if three of your item records have the following three barcodes (not including quotation marks) …
"0538 50211 7517"
"0538513096387 "

And your JSON query has these three barcode character strings …

None of the three barcodes would be found by create lists using the basic JSON query.  It might be best to remove this extra spaces using Global Updates.  Contact Marmot, if you need assistance with this type of Global Update.