[% INCLUDE 'help-top.inc' %]

<h1>MARC Modification Templates</h1>

<p>The MARC Modification Templates system gives Koha users the power to make alterations to MARC records automatically while staging MARC records for import.</p>

<p>This tool is useful for altering MARC records from various vendors/sources work with your MARC framework. The system essentially allows one to create a basic script using actions to Copy, Move, Add, Update and Delete fields.</p>

<p>Start by adding a new template (a template can be made up of one or more actions) by entering a name and clicking 'Create template'.</p>

<p>Next you can add actions to the template by filling in the Action box. For example if you're loading in a batch of files from your EBook vendor you might want to add the biblio item type of EBOOK to the 942$c.</p>

<ul>
    <li>Choose 'Add/Update'</li>
   <li>Enter the field 942 and subfield c</li>
    <li>Enter the value of 'EBOOK' (or whatever your ebook item type code is)</li>
 <li>Provide a description so you can identify this action later</li>
   <li>Click 'Add action'</li>
</ul>

<p>Each action can also have an optional condition to check the value or existence of another field. For example you might want to add the call number to the item record if it's not already there.</p>

<ul>
      <li>Choose 'Copy'</li>
 <li>Decide if you want to copy the first occurrence or all occurrences of the field</li>
 <li>Enter the field 090 (or other biblio call number field) and subfield a to copy</li>
        <li>Enter the 952 field and o subfield to copy to</li>
 <li>Choose 'if'</li>
   <li>Enter the 952 field and o subfield</li>
    <li>Choose "doesn't exist"</li>
        <li>Provide a description so you can identify this action later</li>
   <li>Click 'Add action'</li>
</ul>

<p>The Copy &amp; Move actions also support Regular Expressions, which can be used to automatically modify field values during the copy/move. An example would be to strip out the '$' character in field 020$c.</p>

<ul>
  <li>Choose 'Copy'</li>
 <li>Decide if you want to copy the first occurrence or all occurrences of the field</li>
 <li>Enter the field 020 and subfield c to copy</li>
    <li>Enter the 020 field and c subfield to copy to</li>
 <li>Check the 'RegEx' box and enter your regular expression ( in this case s/\$// )</li>
       <li>Choose 'if'</li>
   <li>Enter the 020 field and c subfield</li>
    <li>Choose "matches"</li>
      <li>Check the 'RegEx' box and enter your regular expression ( in this case m/^\$/ )</li>
       <li>Provide a description so you can identify this action later</li>
   <li>Click 'Add action'</li>
</ul>

<p><strong>Tip:</strong> The value for an update can include variables that change each time the template is used. Currently, the system supports two variables, __BRANCHCODE__ which is replaced with the branchcode of the library currently using the template, and __CURRENTDATE__ which is replaced with the current date in ISO format ( YYYY-MM-DD ).</p>

<p>Once your actions are saved you can view them at the top of the screen. Actions can be moved around using the arrows to the left of them.</p>

<p>Depending on your actions the order may be very important. For example you don't want to delete a field before you copy it to another field.</p>

<p>To add another template you can either start fresh or click the 'Duplicate current template' checkbox to create a copy of an existing template to start with.</p>

<p>Once your template is saved you will be able to pick it when using the Stage MARC Records for Import tool.</p>

<p><strong>See the full documentation for MARC Modification Templates in the <a href="http://manual.koha-community.org/[% helpVersion %]/en/catalogtools.html#marcmodtemplates">manual</a> (online).</strong></p>

[% INCLUDE 'help-bottom.inc' %]