<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Do not allow whitespace only in textfield validation</title><link>https://community.appian.com/discussions/f/general/39816/do-not-allow-whitespace-only-in-textfield-validation</link><description>I have a textField that I do not want users to be able to enter in a space unless it is a part of the case number. 
 For example, users should not be able to enter this: 
 
 But if there are spaces in the case number, then it should be allowed 
 
 
 I</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Do not allow whitespace only in textfield validation</title><link>https://community.appian.com/thread/151912?ContentTypeID=1</link><pubDate>Wed, 08 Oct 2025 19:35:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bcef26bb-1f9f-4d1c-b922-a814c57de2ca</guid><dc:creator>cindyl5142</dc:creator><description>&lt;p&gt;Thank you for all your help as always!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Do not allow whitespace only in textfield validation</title><link>https://community.appian.com/thread/151911?ContentTypeID=1</link><pubDate>Wed, 08 Oct 2025 19:34:31 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9af36512-f2ef-44db-ae93-c4e0dd16727c</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Just an FYI - while this won&amp;#39;t cause an error or anything, the null check in the validation message here is not useful, as all field validations (i.e. things in the &amp;quot;validations&amp;quot; parameter, as opposed to &amp;quot;required&amp;quot; validations which are configured separately) do not fire&amp;nbsp;&lt;strong&gt;under any circumstances&lt;/strong&gt; when the field&amp;#39;s value is null.&amp;nbsp; Hence the validation configuration I already suggested above.&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/11/pastedimage1759952028631v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Do not allow whitespace only in textfield validation</title><link>https://community.appian.com/thread/151900?ContentTypeID=1</link><pubDate>Wed, 08 Oct 2025 05:20:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:baec8883-2463-4727-bf25-6b738c0d25a9</guid><dc:creator>Shubham Aware</dc:creator><description>&lt;p&gt;You try this below code&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!caseNumber,
  a!textField(
    label: &amp;quot;Case Number&amp;quot;,
    labelPosition: &amp;quot;ABOVE&amp;quot;,
    saveInto: local!caseNumber,
    placeholder: &amp;quot;Enter Case Number&amp;quot;,
    refreshAfter: &amp;quot;UNFOCUS&amp;quot;,
    value: local!caseNumber,
    validations: {
      if(
        or(
          a!isNullOrEmpty(local!caseNumber),
          len(trim(local!caseNumber)) = 0
        ),
        &amp;quot;Case Number is invalid.&amp;quot;,
        null()
      )
    }
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Do not allow whitespace only in textfield validation</title><link>https://community.appian.com/thread/151896?ContentTypeID=1</link><pubDate>Tue, 07 Oct 2025 21:22:08 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8bde8ff7-836c-4c96-8b34-28716103a5e5</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;You can only display an error message when a string is entered.&amp;nbsp; So you can choose either to trim the input (thus not allowing only blank space to be entered), or you can use a validation that shows up when removing all blanks would result in a null.&lt;/p&gt;
&lt;p&gt;validations: {&lt;br /&gt;&amp;nbsp;if(&lt;br /&gt;&amp;nbsp; a!isNullOrEmpty(trim(ri!notice)),&lt;br /&gt;&amp;nbsp; &amp;quot;don&amp;#39;t enter only blank spaces&amp;quot;,&lt;br /&gt;&amp;nbsp; null()&lt;br /&gt;&amp;nbsp;)&lt;br /&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Do not allow whitespace only in textfield validation</title><link>https://community.appian.com/thread/151895?ContentTypeID=1</link><pubDate>Tue, 07 Oct 2025 21:10:14 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c89edcdb-c9f1-478a-a2be-1211e456a600</guid><dc:creator>cindyl5142</dc:creator><description>&lt;p&gt;Im looking to also display an error message if there is empty spaces :(&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Do not allow whitespace only in textfield validation</title><link>https://community.appian.com/thread/151894?ContentTypeID=1</link><pubDate>Tue, 07 Oct 2025 21:05:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fda03d69-21ed-4ab0-aaf4-356eee08b220</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;trim your input at save time.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;a!textField(
  label: &amp;quot;notice&amp;quot;,
  value: ri!notice,
  saveInto: a!save(ri!notice, trim(save!value))
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>