<?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>Add specific validation to text</title><link>https://community.appian.com/discussions/f/new-to-appian/23310/add-specific-validation-to-text</link><description>Hi! Just wanna ask how can I make the text file only accept values that are in this format 
 1.1.1 
 1.2.2 
 etc</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Add specific validation to text</title><link>https://community.appian.com/thread/99886?ContentTypeID=1</link><pubDate>Mon, 22 Aug 2022 08:44:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:771cdcd3-9596-46a8-8d91-51282081708d</guid><dc:creator>yogeshc213832</dc:creator><description>&lt;p&gt;It&amp;#39;s working fine now&lt;br /&gt;Thanks for the help :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Add specific validation to text</title><link>https://community.appian.com/thread/99885?ContentTypeID=1</link><pubDate>Mon, 22 Aug 2022 08:21:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:26e1bd9b-8fcd-4bb4-848c-89fe354b836f</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;We&amp;#39;re missing a null check here. See this updated code.&amp;nbsp;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;if(
  or(
    a!isNullOrEmpty(ri!record.totalAmount),
    ri!record.totalAmount = todecimal(fixed(ri!record.totalAmount, 2))
  ),
  {},
  &amp;quot;Invalid value&amp;quot;
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Add specific validation to text</title><link>https://community.appian.com/thread/99883?ContentTypeID=1</link><pubDate>Mon, 22 Aug 2022 07:45:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7e55ee7a-2165-4f5f-ba49-51ff8bd787b0</guid><dc:creator>yogeshc213832</dc:creator><description>&lt;p&gt;hey Harshit&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for the quick reply but it is not working&lt;/p&gt;
&lt;p&gt;I am using this way in the validations expression editor of the decimal field&lt;/p&gt;
&lt;p&gt;if(&lt;br /&gt; ri!record.totalAmount = todecimal(fixed(ri!record.totalAmount, 2)),&lt;br /&gt; {},&lt;br /&gt; &amp;quot;Invalid value&amp;quot;&lt;br /&gt; )&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;getting this error&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong class="StrongText---richtext_strong StrongText---inMessageLayout StrongText---error"&gt;Could not display interface. Please check definition and inputs.&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;Interface Definition: Expression evaluation error at function &amp;#39;fixed&amp;#39; [line 56]: A null parameter has been passed as parameter 1&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Add specific validation to text</title><link>https://community.appian.com/thread/99880?ContentTypeID=1</link><pubDate>Mon, 22 Aug 2022 07:11:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4cc598c0-29d4-4523-8d65-080a071b63b9</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;You are on the right track . Just need one more condition. Check the below code.&amp;nbsp;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;if(
  ri!value = todecimal(fixed(ri!value, 2)),
  {},
  &amp;quot;Invalid value&amp;quot;
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Add specific validation to text</title><link>https://community.appian.com/thread/99875?ContentTypeID=1</link><pubDate>Mon, 22 Aug 2022 06:52:38 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c6c13c3e-d90d-4f06-a646-ca0b500baa21</guid><dc:creator>deepakg681722</dc:creator><description>&lt;p&gt;For validation, you can use the below code.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!dec,
  a!floatingPointField(
    label: &amp;quot;Decimal Number&amp;quot;,
    value: local!dec,
    saveInto: local!dec,
    validations: if(
      a!isNullOrEmpty(local!dec),
      {},
      if(
        regexmatch(
          &amp;quot;^\-?[0-9]+(?:\.[0-9]{1,2})?$&amp;quot;,
          todecimal(local!dec)
        ),
        {},
        &amp;quot;Error&amp;quot;
      )
    )
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Add specific validation to text</title><link>https://community.appian.com/thread/99872?ContentTypeID=1</link><pubDate>Mon, 22 Aug 2022 06:37:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:64d3468a-14dc-4d39-8c29-99622d86d60c</guid><dc:creator>yogeshc213832</dc:creator><description>&lt;p&gt;can you please help me with how can we apply validations on the decimal field&lt;/p&gt;
&lt;p&gt;In the decimal field accept values up to 2 decimal places only.&lt;/p&gt;
&lt;p&gt;I tried with fixed function but it&amp;#39;s not working&lt;/p&gt;
&lt;p&gt;fixed(ri!record.amout,2)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Add specific validation to text</title><link>https://community.appian.com/thread/89499?ContentTypeID=1</link><pubDate>Wed, 05 Jan 2022 08:08:22 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a9885e23-4a88-4d9d-9672-6bc4078d7ee6</guid><dc:creator>saarcenal</dc:creator><description>&lt;p&gt;Thank you very much! worked perfectly!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Add specific validation to text</title><link>https://community.appian.com/thread/89497?ContentTypeID=1</link><pubDate>Wed, 05 Jan 2022 06:48:19 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:18f9fb1d-2ff7-4ba1-ac49-61f6c8ab5564</guid><dc:creator>hrishikeshd997</dc:creator><description>&lt;p&gt;You can use regex functions to match with specific text pattern and use its result for displaying validation on the text field.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;{
  a!textField(
    label: &amp;quot;Release Version&amp;quot;,
    labelPosition: &amp;quot;ABOVE&amp;quot;,
    value: ri!value,
    saveInto: {
      ri!value      
    },
    refreshAfter: &amp;quot;UNFOCUS&amp;quot;,
    validations: {
      if(
        regexmatch(
          &amp;quot;^(\d+\.)(\d+\.)(\*|\d+)$&amp;quot;,
          ri!value
        ),
        {},
        &amp;quot;Enter correct format XX.XX.XX&amp;quot;
      )
    }    
  )
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Use this web based tool to explain / understand the regex pattern -&amp;nbsp;&lt;a href="https://regexr.com/"&gt;https://regexr.com/&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>