<?xml version="1.0" encoding="UTF-8"?>
<helpdocument version="1.0">
<!--
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->

<meta>
  <topic id="textswriterguidefields_userdataxml" indexer="include" status="PUBLISH">
    <title id="tit" xml-lang="en-US">Querying User Data in Fields or Conditions</title>
    <filename>/text/swriter/guide/fields_userdata.xhp</filename>
  </topic>
</meta>

<body>

<bookmark xml-lang="en-US" branch="index" id="bm_id3153398">
  <bookmark_value>fields; user data</bookmark_value>
  <bookmark_value>user data; querying</bookmark_value>
  <bookmark_value>conditions; user data fields</bookmark_value>
  <bookmark_value>hiding;text, from specific users</bookmark_value>
  <bookmark_value>text; hiding from specific users, with conditions</bookmark_value>
  <bookmark_value>user variables in conditions/fields</bookmark_value>
</bookmark>


<h1 id="hd_id3153398"><variable id="fields_userdata"><link href="text/swriter/guide/fields_userdata.xhp">Querying User Data in Fields or Conditions</link></variable></h1>
<paragraph id="par_id3154239" role="paragraph" xml-lang="en-US">You can access and compare some user data from conditions or fields. For example, you can compare user data with the following operators:</paragraph>

<table id="tbl_id3154255">
  <tablerow>
    <tablecell>
      <paragraph id="par_id3155889" role="tablehead" xml-lang="en-US">Operator</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id3147110" role="tablehead" xml-lang="en-US">Meaning</paragraph>
    </tablecell>
  </tablerow>
  <tablerow>
    <tablecell>
      <paragraph id="par_id3150508" role="tablecontent" xml-lang="en-US">== or EQ</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id3150531" role="tablecontent" xml-lang="en-US">equals</paragraph>
    </tablecell>
  </tablerow>
  <tablerow>
    <tablecell>
      <paragraph id="par_id3150725" role="tablecontent" xml-lang="en-US">!= or NEQ</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id3150748" role="tablecontent" xml-lang="en-US">is not equal to</paragraph>
    </tablecell>
  </tablerow>
</table>

<paragraph id="par_id3153167" role="paragraph" xml-lang="en-US">If you want, you can use a condition to hide specific text in your document from a specific user.</paragraph>

<list type="ordered">
  <listitem>
    <paragraph id="par_id3153190" role="listitem" xml-lang="en-US">Select the text in the document that you want to hide.</paragraph>
  </listitem>
  <listitem>
    <paragraph id="par_id3145273" role="listitem" xml-lang="en-US">Choose <emph>Insert - Section</emph>.</paragraph>
  </listitem>
  <listitem>
    <paragraph id="par_id3145297" role="listitem" xml-lang="en-US">In the <item type="menuitem">Hide</item> area, select the <item type="menuitem">Hide</item> check box.</paragraph>
  </listitem>
  <listitem>
    <paragraph id="par_id3155533" role="listitem" xml-lang="en-US">In the <emph>With Condition</emph> box, type <emph>user_lastname == "Doe"</emph>, where "Doe" is the last name of the user that you want to hide the text from.</paragraph>
  </listitem>
  <listitem>
    <paragraph id="par_id3155573" role="listitem" xml-lang="en-US">Click <emph>Insert</emph> and then save the document.</paragraph>
  </listitem>
</list>
<paragraph id="par_id3147760" role="note" xml-lang="en-US">The name of the hidden section can still be seen in the Navigator.</paragraph>
<paragraph id="par_id3147777" role="paragraph" xml-lang="en-US">The following table is a list of the user variables that you can access when defining a condition or a field:</paragraph>

<table id="tbl_id3147793">
  <tablerow>
    <tablecell>
      <paragraph id="par_id3147819" role="tablehead" xml-lang="en-US">User variables</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id3147218" role="tablehead" xml-lang="en-US">Meaning</paragraph>
    </tablecell>
  </tablerow>
  <tablerow>
    <tablecell>
      <paragraph id="par_id3147245" role="code" xml-lang="en-US">user_firstname</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id3147268" role="paragraph" xml-lang="en-US">First name</paragraph>
    </tablecell>
  </tablerow>
  <tablerow>
    <tablecell>
      <paragraph id="par_id3145592" role="code" xml-lang="en-US">user_lastname</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id3145615" role="paragraph" xml-lang="en-US">Last name</paragraph>
    </tablecell>
  </tablerow>
  <tablerow>
    <tablecell>
      <paragraph id="par_id3145642" role="code" xml-lang="en-US">user_initials</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id3145666" role="paragraph" xml-lang="en-US">Initials</paragraph>
    </tablecell>
  </tablerow>
  <tablerow>
    <tablecell>
      <paragraph id="par_id3151200" role="code" xml-lang="en-US">user_company</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id3151223" role="paragraph" xml-lang="en-US">Company</paragraph>
    </tablecell>
  </tablerow>
  <tablerow>
    <tablecell>
      <paragraph id="par_id3151250" role="code" xml-lang="en-US">user_street</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id3152912" role="paragraph" xml-lang="en-US">Street</paragraph>
    </tablecell>
  </tablerow>
  <tablerow>
    <tablecell>
      <paragraph id="par_id3152940" role="code" xml-lang="en-US">user_country</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id3152963" role="paragraph" xml-lang="en-US">Country</paragraph>
    </tablecell>
  </tablerow>
  <tablerow>
    <tablecell>
      <paragraph id="par_id3152990" role="code" xml-lang="en-US">user_zipcode</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id3145679" role="paragraph" xml-lang="en-US">Zip Code</paragraph>
    </tablecell>
  </tablerow>
  <tablerow>
    <tablecell>
      <paragraph id="par_id3145706" role="code" xml-lang="en-US">user_city</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id3145729" role="paragraph" xml-lang="en-US">City</paragraph>
    </tablecell>
  </tablerow>
  <tablerow>
    <tablecell>
      <paragraph id="par_id3145756" role="code" xml-lang="en-US">user_title</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id3145779" role="paragraph" xml-lang="en-US">Title</paragraph>
    </tablecell>
  </tablerow>
  <tablerow>
    <tablecell>
      <paragraph id="par_id3156284" role="code" xml-lang="en-US">user_position</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id3156307" role="paragraph" xml-lang="en-US">Position</paragraph>
    </tablecell>
  </tablerow>
  <tablerow>
    <tablecell>
      <paragraph id="par_id3156334" role="code" xml-lang="en-US">user_tel_work</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id3156357" role="paragraph" xml-lang="en-US">Business telephone number</paragraph>
    </tablecell>
  </tablerow>
  <tablerow>
    <tablecell>
      <paragraph id="par_id3156384" role="code" xml-lang="en-US">user_tel_home</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id3149728" role="paragraph" xml-lang="en-US">Home telephone number</paragraph>
    </tablecell>
  </tablerow>
  <tablerow>
    <tablecell>
      <paragraph id="par_id3149756" role="code" xml-lang="en-US">user_fax</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id3149778" role="paragraph" xml-lang="en-US">Fax number</paragraph>
    </tablecell>
  </tablerow>
  <tablerow>
    <tablecell>
      <paragraph id="par_id3149806" role="code" xml-lang="en-US">user_email</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id3147294" role="paragraph" xml-lang="en-US">Email address</paragraph>
    </tablecell>
  </tablerow>
  <tablerow>
    <tablecell>
      <paragraph id="par_id3147321" role="code" xml-lang="en-US">user_state</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id3147344" role="paragraph" xml-lang="en-US">State</paragraph>
    </tablecell>
  </tablerow>
</table>


<section id="relatedtopics">
<embed href="text/swriter/guide/fields.xhp#fields"/>
<embed href="text/swriter/guide/conditional_text.xhp#conditional_text"/>
<embed href="text/swriter/guide/hidden_text.xhp#hidden_text"/>
<paragraph id="par_id3147392" role="paragraph" xml-lang="en-US"><link href="text/swriter/02/14020000.xhp">List of operators</link></paragraph>
</section>
</body>

</helpdocument>