| Server IP : 121.121.20.254 / Your IP : 216.73.216.202 Web Server : Microsoft-IIS/10.0 System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64 User : IUSR ( 0) PHP Version : 8.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/Program Files/LibreOffice/help/en-US/text/swriter/guide/ |
Upload File : |
<!DOCTYPE html>
<html lang="en-US" dir="ltr">
<head>
<base href="../../../../">
<noscript><meta http-equiv="refresh" content="0; URL=../../../../en-US/noscript.html"></noscript>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Conditional Text</title>
<link rel="shortcut icon" href="media/navigation/favicon.ico">
<link type="text/css" href="normalize.css" rel="Stylesheet">
<link type="text/css" href="prism.css" rel="Stylesheet">
<link type="text/css" href="default.css" rel="Stylesheet">
<script type="text/javascript" src="polyfills.js"></script><script type="text/javascript" src="languages.js"></script><script type="text/javascript" src="en-US/langnames.js"></script><script type="text/javascript" src="flexsearch.debug.js"></script><script type="text/javascript" src="prism.js"></script><script type="text/javascript" src="help2.js" defer></script><script type="text/javascript" src="a11y-toggle.js" defer></script><script type="text/javascript" src="paginathing.js" defer></script><script type="text/javascript" src="en-US/bookmarks.js" defer></script><script type="text/javascript" src="en-US/contents.js" defer></script><script type="text/javascript" src="help.js" defer></script><meta name="viewport" content="width=device-width,initial-scale=1">
</head>
<body>
<header id="TopLeftHeader"><a class="symbol" href="en-US/text/shared/05/new_help.html"><div></div></a><a class="logo" href="en-US/text/shared/05/new_help.html"><p dir="auto">LibreOffice 24.2 Help</p></a><div class="dropdowns"><div class="modules">
<button type="button" data-a11y-toggle="modules-nav" id="modules" aria-haspopup="true" aria-expanded="false" aria-controls="modules-nav">Module</button><nav id="modules-nav" hidden=""></nav>
</div></div></header><aside class="leftside"><input id="accordion-1" name="accordion-menu" type="checkbox"><label for="accordion-1" dir="auto">Contents</label><div id="Contents" class="contents-treeview"></div></aside><div id="SearchFrame"><div id="Bookmarks">
<input id="search-bar" type="search" class="search" placeholder="Search in bookmarks for chosen module" dir="auto"><div class="nav-container" tabindex="0"><nav class="index" dir="auto"></nav></div>
</div></div>
<div id="DisplayArea" itemprop="softwareHelp" itemscope="true" itemtype="http://schema.org/SoftwareApplication">
<a name="bm_id3155619"></a>
<meta itemprop="keywords" content="matching conditional text in fields">
<meta itemprop="keywords" content="if-then queries as fields">
<meta itemprop="keywords" content="conditional text, setting up">
<meta itemprop="keywords" content="text, conditional text">
<meta itemprop="keywords" content="defining,conditions">
<h1 id="hd_id3155619" dir="auto">
<a name="conditional_text"></a>Conditional Text</h1>
<p id="par_id3155879" class="paragraph" dir="auto">You can set up fields in your document that display text when a condition that you define is met. For example, you can define the conditional text that is displayed in a series of reminder letters.</p>
<p id="par_id3155895" class="paragraph" dir="auto">Setting up conditional text in this example is a two-part process. First you create a variable, and then you create the condition.</p>
<h2 id="hd_id3153175" dir="auto">To Define a Conditional Variable</h2>
<p id="par_id3153185" class="paragraph" dir="auto">The first part of the example is to define a variable for the condition statement.</p>
<ol itemprop="HowTo" itemscope="true" itemtype="http://schema.org/HowToSection" dir="auto">
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3155566" class="listitem" dir="auto">Choose <span class="menuitem">Insert - Field - More Fields</span>, and then click the <span class="menuitem">Variables</span> tab.</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3147759" class="listitem" dir="auto">Click "Set variable" in the <span class="menuitem">Type</span> list.</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3147784" class="listitem" dir="auto">Type a name for the variable in the <span class="menuitem">Name</span> box, for example <span class="literal">Reminder</span>.</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3147810" class="listitem" dir="auto">Click "Text" in the <span class="menuitem">Format</span> list.</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id7748344" class="listitem" dir="auto">Enter <span class="literal">1</span> in the <span class="menuitem">Value</span> box, and then click <span class="menuitem">Insert</span>.<br>The Format list now displays a "General" format.</p>
</li>
</ol>
<h2 id="hd_id3145645" dir="auto">To Define a Condition and the Conditional Text</h2>
<p id="par_id3145659" class="paragraph" dir="auto">The second part of the example is to define the condition that must be met, and to insert a placeholder for displaying the conditional text in your document.</p>
<ol itemprop="HowTo" itemscope="true" itemtype="http://schema.org/HowToSection" dir="auto">
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3151193" class="listitem" dir="auto">Place the cursor where you want to insert the conditional text in your text.</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3151212" class="listitem" dir="auto">Choose <span class="menuitem">Insert - Field - More Fields</span>, and then click the <span class="menuitem">Functions</span> tab.</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3151250" class="listitem" dir="auto">Click "Conditional text" in the <span class="menuitem">Type</span> list.</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3155936" class="listitem" dir="auto">Type <span class="literal">Reminder EQ "3"</span> in the <span class="menuitem">Condition</span> box. In other words, the conditional text will be displayed when the variable in the field that you defined in the first part of this example is equal to three.</p>
<p id="par_id3155969" class="listitem" dir="auto">The quotation marks enclosing the "3" indicate that the variable that you defined in the first part of this example is a text string.</p>
</li>
</ol>
<ol itemprop="HowTo" itemscope="true" itemtype="http://schema.org/HowToSection" dir="auto" start="5">
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3150446" class="listitem" dir="auto">Type the text that you want to display when the condition is met in the <span class="emph">Then</span> box. There is almost no limit to the length of the text that you can enter. You can paste a paragraph into this box.</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3150473" class="listitem" dir="auto">Click <span class="emph">Insert</span>, and then click <span class="emph">Close</span>.</p>
</li>
</ol>
<h2 id="hd_id3155073" dir="auto">To Display the Conditional Text</h2>
<p id="par_id3155086" class="paragraph" dir="auto">In this example, the conditional text is displayed when the value of the conditional variable is equal to 3.</p>
<ol itemprop="HowTo" itemscope="true" itemtype="http://schema.org/HowToSection" dir="auto">
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3155110" class="listitem" dir="auto">Place your cursor in front of the field that you defined in the first part of this example, and then choose <span class="emph">Edit - Fields</span>.</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3155136" class="listitem" dir="auto">Replace the number in the <span class="menuitem">Value</span> box with 3, and then click <span class="menuitem">Close</span>.</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3155168" class="listitem" dir="auto">If the field does not automatically update, press F9.</p>
</li>
</ol>
<a name="relatedtopics"></a><div class="relatedtopics">
<p class="related" itemprop="mentions" dir="auto"><a name="related"></a><span class="emph">Related Topics</span>
</p>
<div class="relatedbody" itemprop="mentions">
<div class="embedded"><p class="embedded" dir="auto"><a target="_top" href="en-US/text/swriter/guide/fields_userdata.html">Querying User Data in Fields or Conditions</a></p></div>
<div class="embedded"><p class="embedded" dir="auto"><a target="_top" href="en-US/text/swriter/guide/conditional_text2.html">Conditional Text for Page Counts</a></p></div>
<div class="embedded"><p class="embedded" dir="auto"><a target="_top" href="en-US/text/swriter/01/04090200.html">Defining Conditions</a>
</p></div>
<p id="par_id3145714" class="paragraph" dir="auto"><a target="_top" href="en-US/text/swriter/02/14020000.html">List of conditional operators</a></p>
</div>
</div>
</div>
<div id="DonationFrame"></div>
<footer><div id="DEBUG" class="debug">
<h3 class="bug">Help content debug info:</h3>
<p dir="auto">This page is: <a href="https://opengrok.libreoffice.org/xref/help/source/text/swriter/guide/conditional_text.xhp" target="_blank">/text/swriter/guide/conditional_text.xhp</a></p>
<p dir="auto">Title is: Conditional Text</p>
<p id="bm_module" dir="auto"></p>
<p id="bm_system" dir="auto"></p>
<p id="bm_HID" dir="auto"></p>
</div></footer>
</body>
</html>