title: SharePoint get current user attribute
body: <p>I have a page that needs to retrieve the department for the logged-in user.  Ideally I'd like to be able to do it through a JavaScript SOAP CAML query.  I have the user's id (which I'm assuming doubles as the GUID), so it seems like a simple matter of retrieving the row that matches the ID.</p>
  
  <p>I'm looking into using the 'GetUserProfileByIndex' or 'GetUserProfileByGuid' function in SOAP, but I can't seem to find any solid documentation or decent examples using them.  I'm hoping to do something like this in JavaScript - (which isn't working):</p>
  
  <pre><code> var userId = 194;
   "&lt;soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'&gt; \
       &lt;soapenv:Body&gt; \
           &lt;GetUserProfileByIndex  xmlns='http://microsoft.com/webservices/SharePointPortalServer/UserProfileService'&gt; \
               &lt;index&gt;userId&lt;/index&gt; \
           &lt;/GetUserProfileByIndex &gt; \
       &lt;/soapenv:Body&gt; \
   &lt;/soapenv:Envelope&gt;";
  </code></pre>