<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi Jeremiah,</p>
    <p>if you already have user object, you can use
      basic.getExtensionPropertyValue / basic.getExtensionPropertyValues
      function as in:</p>
    <p>basic.getExtensionPropertyValue(thisUser,
      <a class="moz-txt-link-rfc2396E" href="http://example.com/midpoint">"http://example.com/midpoint"</a>, "empStatus")</p>
    <p>In this example, "empStatus" is my extension attribute and
      <a class="moz-txt-link-rfc2396E" href="http://example.com/midpoint">"http://example.com/midpoint"</a> is my extension schema namespace.<br>
    </p>
    <p>See also
<a class="moz-txt-link-freetext" href="https://docs.evolveum.com/midpoint/reference/expressions/expressions/script/functions/#basic-library">https://docs.evolveum.com/midpoint/reference/expressions/expressions/script/functions/#basic-library</a></p>
    <p>Hope this helps.</p>
    <p>Best regards,</p>
    <p>Ivan<br>
    </p>
    <div class="moz-cite-prefix">On 13. 7. 2021 15:57, Haywood, Jeremiah
      via midPoint wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CH0PR03MB605025E7DD0313CCC3F4AD51E4149@CH0PR03MB6050.namprd03.prod.outlook.com">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style>@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}span.EmailStyle19
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}p.codeSnippet, li.codeSnippet, div.codeSnippet
        {mso-style-name:codeSnippet;
        mso-style-link:"codeSnippet Char";
        margin:0in;
        background:#E5E5E5;
        font-size:9.0pt;
        font-family:Consolas;
        color:black;}span.codeSnippetChar
        {mso-style-name:"codeSnippet Char";
        mso-style-link:codeSnippet;
        font-family:Consolas;
        color:black;
        background:#E5E5E5;}.MsoChpDefault
        {mso-style-type:export-only;}div.WordSection1
        {page:WordSection1;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal">Has anyone worked with the Midpoint query
          api and returning extension attribute values for users? It
          seems the default schema attributes can be accessed by name
          fairly easily. Have been looking at the UserType (<a
href="https://download.evolveum.com/midpoint/4.2/midpoint-4.2-javadoc/com/evolveum/midpoint/xml/ns/_public/common/common_3/UserType.html"
            moz-do-not-send="true">https://download.evolveum.com/midpoint/4.2/midpoint-4.2-javadoc/com/evolveum/midpoint/xml/ns/_public/common/common_3/UserType.html</a>)
          class but can't seem to find a method to directly access the
          extension attributes. Was hoping there wouldn’t be a need for
          regex.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Example:<o:p></o:p></p>
        <p class="codeSnippet">// query for user<o:p></o:p></p>
        <p class="codeSnippet">thisUser =
          midpoint.searchObjects(UserType.class, userQuery, null)<o:p></o:p></p>
        <p class="codeSnippet"><o:p> </o:p></p>
        <p class="codeSnippet">// returns value for givenName<o:p></o:p></p>
        <p class="codeSnippet">thisUser.givenName<o:p></o:p></p>
        <p class="codeSnippet"><o:p> </o:p></p>
        <p class="codeSnippet">//returns an arraylist, with additional
          unwanted info<o:p></o:p></p>
        <p class="codeSnippet">thisUser.extension<o:p></o:p></p>
        <p class="codeSnippet"><o:p> </o:p></p>
        <p class="codeSnippet">e.g.<o:p></o:p></p>
        <p class="codeSnippet">[PCV(null):[PP({<a class="moz-txt-link-freetext" href="http://customSchema.com/xml/ns/customSchema">http://customSchema.com/xml/ns/customSchema</a>}preferredFirstName):[PPV(String:Luke)]]<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Thank you,<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Jeremiah Haywood<o:p></o:p></p>
        <p class="MsoNormal">Identity and Access Management
          Administrator <o:p></o:p></p>
        <p class="MsoNormal">Office of Technology Solutions | Illinois
          State University<o:p></o:p></p>
        <p class="MsoNormal">Phone Number (309) 438-3829<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-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="https://lists.evolveum.com/mailman/listinfo/midpoint">https://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Ivan Noris
Senior Identity Engineer
evolveum.com
</pre>
  </body>
</html>