<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/xdmp.getServerField.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>xdmp.getServerField</api:function-name><api:suggest>xdmp.getserverfield</api:suggest><api:suggest>xdmp</api:suggest><api:suggest>getserverfield</api:suggest><api:function-link mode="xquery" fullname="xdmp:get-server-field">/apidoc/8.0/xdmp:get-server-field.xml</api:function-link><api:function mode="javascript" name="getServerField" type="builtin" lib="xdmp" category="AppServerBuiltins" hidden="false" bucket="MarkLogic Built-In Functions" prefix="xdmp" namespace="http://marklogic.com/xdmp" fullname="xdmp.getServerField"><api:summary>
  Returns the value of a named server field. A server field is created with
  <code xmlns="http://www.w3.org/1999/xhtml">xdmp:set-server-field</code> and stores a name/value
  pair in memory.  The server field is available on the App Server in which
  it is set on the host in which the App Server runs, via
  <code xmlns="http://www.w3.org/1999/xhtml">xdmp:get-server-field</code>; a server field that is set on one
  App Server is not available on other App Servers on that host or on the same
  App Server running on another host.  Server fields are commonly used
  with the system Plugin Framework.
</api:summary><api:params><api:param name="name" type="xs:string"><api:param-description>
    The name of the server field.
  </api:param-description><api:param-name>name</api:param-name><api:param-type>String</api:param-type></api:param><api:param name="default" type="item()*" optional="true"><api:param-description>
    A default value to return if there is no server field.
  </api:param-description><api:param-name>default</api:param-name><api:param-type>ValueIterator</api:param-type></api:param></api:params><api:return>ValueIterator</api:return><api:privilege>
  <p xmlns="http://www.w3.org/1999/xhtml"><code>http://marklogic.com/xdmp/privileges/xdmp-get-server-field</code></p>
</api:privilege><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
xdmp.getServerField("foo");
=&gt; "bar"
</pre></api:example></api:function></api:function-page>