<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hello Matt,</p>
    <p>I assume you get something like "unknown variable 'birthdate'"
      exception. When creating inbound mappings, you refer to the
      incoming value (from the resource) via "input" variable.</p>
    <p>So your line should be something like Date.parse(..., input).</p>
    <p>Best regards,<br>
    </p>
    <pre class="moz-signature" cols="72">Pavol Mederly
Software developer
evolveum.com
</pre>
    <div class="moz-cite-prefix">On 23.08.2016 19:10, Mencel, Matt
      wrote:<br>
    </div>
    <blockquote
cite="mid:CABpVbHLNecx=WEHCe4zLQ3HGQeAc_+swphrUSA3ys_pB-s1n1w@mail.gmail.com"
      type="cite">
      <div dir="ltr">So in my CSV I have a birthday field stored as a
        string value like so... '20160822'.  I've created a DOB field in
        my custom schema of type date...
        <div><br>
        </div>
        <div>
          <div><font face="monospace, monospace">           
              <xsd:element name="birthDate" type="xsd:date"
              minOccurs="0" maxOccurs="1"></font></div>
          <div><font face="monospace, monospace">               
              <xsd:annotation></font></div>
          <div><font face="monospace, monospace">                   
              <xsd:appinfo></font></div>
          <div><font face="monospace, monospace">                       
              <a:indexed>false</a:indexed></font></div>
          <div><font face="monospace, monospace">                       
              <a:displayName>DOB</a:displayName></font></div>
          <div><font face="monospace, monospace">                       
              <a:displayOrder>130</a:displayOrder></font></div>
          <div><font face="monospace, monospace">                   
              </xsd:appinfo></font></div>
          <div><font face="monospace, monospace">               
              </xsd:annotation></font></div>
          <div><font face="monospace, monospace">           
              </xsd:element></font></div>
        </div>
        <div><br>
        </div>
        <div>and am trying to parse the string to the date field using
          the following in my mapping...which doesn't work at the
          moment.</div>
        <div><br>
        </div>
        <attribute><br>
        <ref>ri:birthdate</ref><br>
        <displayName>DOB</displayName><br>
        <inbound><br>
        <target><br>
        <path>$user/extension/birthDate</path><br>
        </target><br>
        <expression><br>
                   <script><br>
                       <language><a moz-do-not-send="true"
href="http://midpoint.evolveum.com/xml/ns/public/expression/language#Groovy">http://midpoint.evolveum.com/xml/ns/public/expression/language#Groovy</a></language><br>
                       <code><br>
                           Date.parse('yyyymmdd', birthdate)<br>
                       </code><br>
                   </script><br>
               </expression><br>
        </inbound><br>
        </attribute>
        <div><font face="monospace, monospace"><br>
          </font></div>
        <div><font face="monospace, monospace">Do I need to do the
            script in the user object template instead?</font></div>
        <div><font face="monospace, monospace"><br>
          </font></div>
        <div><font face="monospace, monospace">Thanks,</font></div>
        <div><font face="monospace, monospace">Matt</font></div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
midPoint mailing list
<a class="moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a>
<a class="moz-txt-link-freetext" href="http://lists.evolveum.com/mailman/listinfo/midpoint">http://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>