Advanced Configuration Options for the Patron Import Converter

This document outlines CUSTOM formats and other available options for converting CSV information to XML data. It assumes you have your CSV and patronimportconverter.exe files available. If you do not have these files, see Patron Import Converter (Simple) to start using the Patron Import Converter (PIC) to convert your CSV.

  1. In your working folder, double-click PatronImportConverter.exe.
  2. To select the CSV file, click Browse, and then find and select the file.
  3. Click the Field Mapping tab.

Enter Custom Mapping and Formatting

For a field whose values require special formatting, concatenation or added text, select CUSTOM in the Format column.

Format column of the Patron Import Converter

The Edit Custom Format pop-up appears.

Edit Custom Format in the Patron Import Converter

Important: Do not add quotation marks or CDATA statements. The PIC inserts the necessary CDATA statements into the XML file.

Use Literal Fields (Static Fields)

Literal fields are fields where the data does not change. You can type an entry, and it will apply to all patrons that are processed through the Patron Import Converter.

Example:

You only have one site in Destiny and do not have the required Site Short Name field in your CSV file. Each patron will be in Main Street High School (Site Short Name = MSHS).

  1. In the Format column, select CUSTOM without choosing a CSV Input Field. The Edit Custom Format pop-up appears.
  2. Type MSHS, and then click OK.

All patrons will be given a MSHS Site Short Name in the XML.

Combine Fields (Concatenation)

You can combine fields in the Edit Custom Format pop-up. Each field can be referenced by the column number assigned to it. To reference the field number, wrap it in braces { }.

Examples: 

  1. To reference the districtid in the example image below, place {3} in the Edit Custom Format pop-up.

    Column numbers assiged to fields in the pop-up

  2. Let's say Field 13 in your CSV file contains the homeroom number, and Field 6 contains the homeroom adviser. If you want to reference both in Destiny's Homeroom field, enter the field numbers, surrounding them with braces:

    {6} {13}

    Result: A patron with adviser Jones in homeroom 25 will show "Jones25" in Destiny's Homeroom field.

    You can also combine literal characters and field numbers. To see "25 – Jones" in Destiny's Homeroom field, enter {13} – {6}.

Map Empty Fields

To have the PIC insert the contents of another field when it encounters an empty field, use the ISEMPTY command on a separate line. Be sure to specify all parts of the command:

  • The ISEMPTY command
  • The field to evaluate
  • The field to insert if the evaluated field is blank
  • The field to insert if the evaluated field is not blank

Example: In this example, if Field 7 is blank, the PIC will populate it with the contents of Field 6. Otherwise, it will populate Field 7 with its own contents:

ISEMPTY({7},{6},{7})

Let's say Field 7 contains the patron's nickname, and Field 6 contains the patron's first name. ISEMPTY({7},{6},{7}) would prompt Destiny to show the nickname when it is available and the first name if it is not.

Important: Be sure to format the command as shown in the example, including all brackets, commas and parentheses.

Use and Combine Partial Fields

Substring is a programming function that takes two values. The first value is a character location, and the second is how many characters to keep from that starting location.

Note: Working with substrings can be complicated and may require some trial and error.

To work with parts of a field in the Patron Import Converter, you can use the substring command. This command lets you use a portion of a CSV field to make another field. The amount of characters is not variable. You must specify a starting character that will be used every time. To use this, you will need the parts of the command in this order:

  • The field number
  • The word "substring"
  • The letter or number to start at (counting from left)
  • How many characters to use from that starting point

Examples:

  1. Let's say Field 5 contains the data 1234567890. If you want to start at position 4 and keep 2 of the characters, in the Edit Custom Format pop-up, enter {5,substring(4,2)}. The Destiny field will show 45.
  2. Let's say Field 5 in your CSV file is a phone number, but you want Destiny to show the area code, prefix and line number separated. In the Edit Custom Format pop-up, enter: 

    ({5,substring (1,3)}) {5,substring (4,3)}-{5,substring (7,4)}.

    What does it mean?

    • area code ({5,substring (1,3)}): Within literal characters for parentheses, the first substring tells the converter to read field 5 starting at character 1, and then keep 3 characters.
    • Then a space is added as a literal character.
    • prefix {5,substring (4,3)}: The second substring tells the converter to read field 5 starting at character 4, and then keep 3 characters.
    • Then a hyphen is added as a literal character.
    • line number {5,substring (7,4)}: The last substring tells the converter to read field 5 starting at character 7, and then keep 4 characters.

    Result: In Destiny, the patron record would show the formatted phone number: (123) 456-7890.

Printable PDF file