<?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>Restricting user from entering text after certain character limit</title><link>https://community.appian.com/discussions/f/user-interface/34918/restricting-user-from-entering-text-after-certain-character-limit</link><description>Hi all, We have a business requirement where the user will enter data into a text field and if the data reaches a certain character limit say 100, we should not allow users to type more than 100. Like they want it to be freezed or stopped at 100 character</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Restricting user from entering text after certain character limit</title><link>https://community.appian.com/thread/134968?ContentTypeID=1</link><pubDate>Wed, 08 May 2024 15:56:14 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:003abfda-95b2-4dc6-be99-516e0c4606c6</guid><dc:creator>sarathkumar13</dc:creator><description>&lt;p&gt;We did the same &lt;a href="/members/mikes0011"&gt;Mike Schmitt&lt;/a&gt;&amp;nbsp;. This is the closest we can go but it does not seem that much convincing to the business. They are expecting like a hardstop which they are comparing it with some other UI from some external system which is not possible in appian. As Stefan suggested, we will push back the requirement.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Restricting user from entering text after certain character limit</title><link>https://community.appian.com/thread/134967?ContentTypeID=1</link><pubDate>Wed, 08 May 2024 15:27:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9e424be4-7d92-44ec-a87c-2fafc7e5f8c3</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;I have found it LARGELY sufficient to simply utilize Appian&amp;#39;s newer, built-in &amp;quot;character limit&amp;quot; functionality with &amp;quot;show character limit&amp;quot; turned ON.&lt;/p&gt;
&lt;p&gt;It does not physically STOP users from entering more characters than the limit, but it is VERY visible and makes it VERY easy for the user to comply.&lt;/p&gt;
&lt;p&gt;If you MUST have something like you describe (which i&amp;#39;d be curious to hear the business owners&amp;#39; rationale behind), then a solution like HARSH posted above but with &amp;quot;refresh after keypress&amp;quot; turned on, will be your closest option.&amp;nbsp; It won&amp;#39;t work perfectly though.&amp;nbsp; (You can use the character limit visibility to your advantage here too).&lt;/p&gt;
&lt;p&gt;Edit: actually &amp;quot;refresh on keypress&amp;quot; doesn&amp;#39;t help a whole lot here - either way, here&amp;#39;s my revised code (shortened the limit temporarily for easier testing)&lt;br /&gt;&lt;pre class="ui-code" data-mode="java"&gt;a!localVariables(
  local!description,
  local!limit: 20,
  
  a!textField(
    label: &amp;quot;Description&amp;quot;,
    instructions: &amp;quot;You can only add &amp;quot; &amp;amp; local!limit &amp;amp; &amp;quot; characters in this field, system will auto trim the characters after 100th character&amp;quot;,
    value: local!description,
    refreshAfter: &amp;quot;KEYPRESS&amp;quot;,
    characterLimit: local!limit,
    showCharacterCount: true(),
    saveInto: {
      a!save(local!description, left(save!value, local!limit))
    }
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Restricting user from entering text after certain character limit</title><link>https://community.appian.com/thread/134966?ContentTypeID=1</link><pubDate>Wed, 08 May 2024 15:26:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ff98d34d-4b1b-44a1-97fe-163e4d002630</guid><dc:creator>Harsh Kumar Agarwal</dc:creator><description>&lt;p&gt;This is a really specific case &lt;span class="emoticon" data-url="https://community.appian.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;You can discuss with business why they want it specifically and then push back explaining the behaviour of Appian components.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Restricting user from entering text after certain character limit</title><link>https://community.appian.com/thread/134965?ContentTypeID=1</link><pubDate>Wed, 08 May 2024 15:01:53 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fd73591a-1e85-4cae-92b6-bd2cf4ad45f0</guid><dc:creator>sarathkumar13</dc:creator><description>&lt;p&gt;Got it. Thanks &lt;a href="/members/stefanhelzle0001"&gt;Stefan Helzle&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Restricting user from entering text after certain character limit</title><link>https://community.appian.com/thread/134964?ContentTypeID=1</link><pubDate>Wed, 08 May 2024 15:00:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7d52da9c-edda-4f93-9770-0015d496789c</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;I do not suggest to go that route, but to push back that &amp;quot;requirement&amp;quot;.&lt;/p&gt;
&lt;p&gt;And yes, you would have to build that yourself.&lt;/p&gt;
&lt;p&gt;Everybody has its own set of expectations, but&amp;nbsp;Appian cannot make everybody happy ;-)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Restricting user from entering text after certain character limit</title><link>https://community.appian.com/thread/134963?ContentTypeID=1</link><pubDate>Wed, 08 May 2024 14:58:09 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c3d76cf4-5313-4b18-838c-65000ebb3557</guid><dc:creator>sarathkumar13</dc:creator><description>&lt;p&gt;&lt;a href="/members/harshk1671"&gt;Harsh Kumar Agarwal&lt;/a&gt;&amp;nbsp;, we tried the same but you can enter the data after 100 also. Unless there is a key press, it will continue to allow and only when a key is pressed, the save will execute and that is something which&amp;nbsp;business wont accept.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Restricting user from entering text after certain character limit</title><link>https://community.appian.com/thread/134961?ContentTypeID=1</link><pubDate>Wed, 08 May 2024 14:56:31 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c82a1249-940f-4741-af93-a87b6a8e2410</guid><dc:creator>sarathkumar13</dc:creator><description>&lt;p&gt;&amp;nbsp;&lt;a href="/members/stefanhelzle0001"&gt;Stefan Helzle&lt;/a&gt;&amp;nbsp;,custom component plugin means something we should&amp;nbsp;build or are they already available in app market?&lt;br /&gt;Plus, its not like a deal breaking requirement, just they are expecting something more out of appian&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Restricting user from entering text after certain character limit</title><link>https://community.appian.com/thread/134960?ContentTypeID=1</link><pubDate>Wed, 08 May 2024 14:44:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8aa9be68-5431-45d1-b36c-144420936578</guid><dc:creator>Harsh Kumar Agarwal</dc:creator><description>&lt;p&gt;You can try using the below code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!description,
  a!textField(
    label: &amp;quot;Description&amp;quot;,
    instructions: &amp;quot;You can only add 100 characters in this field, system will auto trim the characters after 100th character&amp;quot;,
    value: local!description,
    saveInto: {
      a!save(local!description, left(save!value, 100))
    }
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This way it will never throw the validation but auto trim the characters after 100.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Restricting user from entering text after certain character limit</title><link>https://community.appian.com/thread/134959?ContentTypeID=1</link><pubDate>Wed, 08 May 2024 14:37:19 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bfa03572-dcdd-4d0f-a233-ac7e388ba350</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;No, you cannot prevent the user from continue typing.&lt;/p&gt;
&lt;p&gt;In case this is a deal breaking requirement, which I have my doubts on, this would call for a custom component plugin.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>