<?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>How to skip required fields but not the custom validations of fields with a press of button?</title><link>https://community.appian.com/discussions/f/user-interface/12767/how-to-skip-required-fields-but-not-the-custom-validations-of-fields-with-a-press-of-button</link><description>I have a form which has a secondary button which is supposed to skip required fields but not the custom validation of fields after pressing that button. Is there a way to do this?</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to skip required fields but not the custom validations of fields with a press of button?</title><link>https://community.appian.com/thread/57203?ContentTypeID=1</link><pubDate>Wed, 27 Jun 2018 08:10:56 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b2e819c6-a901-4d75-8c12-06b66256e4d9</guid><dc:creator>vimalkumars</dc:creator><description>Hi mohits001,&lt;br /&gt;
&lt;br /&gt;
To have the asterisk(*)&lt;br /&gt;
You can give the label for TextField as below: &lt;br /&gt;
                label: &amp;quot;Name &amp;quot;&amp;amp; if(ri!required, &amp;quot;*&amp;quot;, &amp;quot;&amp;quot;)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to skip required fields but not the custom validations of fields with a press of button?</title><link>https://community.appian.com/thread/57192?ContentTypeID=1</link><pubDate>Wed, 27 Jun 2018 06:41:25 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:33d4f47d-fde2-4ff7-a1a7-f2516bb14eb4</guid><dc:creator>mohitshah</dc:creator><description>&lt;p&gt;Hi Jose,&lt;br /&gt; &lt;br /&gt; Thanks for that solution. I didn&amp;#39;t know we could change validationGroups based on a condition.&lt;br /&gt; &lt;br /&gt; Btw! I think i will have to use rich text field for asterisk(*) though.&lt;br /&gt; &lt;br /&gt; vimalkumars,&lt;br /&gt; &lt;br /&gt; That was an interesting way to put a validation message. Although, Jose solution fits more to my use case.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Mohit&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to skip required fields but not the custom validations of fields with a press of button?</title><link>https://community.appian.com/thread/57185?ContentTypeID=1</link><pubDate>Wed, 27 Jun 2018 05:34:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b79f9e84-b47b-4cef-b8d3-1f670b5513f0</guid><dc:creator>paragk998</dc:creator><description>Hi&lt;br /&gt;
are you using required and custom validation on same field ?&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to skip required fields but not the custom validations of fields with a press of button?</title><link>https://community.appian.com/thread/57184?ContentTypeID=1</link><pubDate>Wed, 27 Jun 2018 05:24:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ad305654-6142-46af-a434-b773927a5028</guid><dc:creator>josep</dc:creator><description>&lt;p&gt;Hello Mohits,&lt;/p&gt;
&lt;p&gt;Let me insist with the validationGroup plus a&amp;nbsp;custom validation that you wanted. I insist on this because when coding interfaces I prefer to keep as much as possible the validations close to the field. unless you have a huge form on which you might need a a!validationMessage.&lt;/p&gt;
&lt;p&gt;Finally consider the use of the&amp;nbsp;refreshAfter: &amp;quot;KEYPRESS&amp;quot; as a way to make aware the user that the input is not correct.&lt;/p&gt;
&lt;p&gt;I think the following code can make the work. In the code you can change the validationGroup based of a condition&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;load(
  local!text1: &amp;quot;&amp;quot;,
  local!text2: &amp;quot;&amp;quot;,
  a!formLayout(
    contents: a!columnsLayout(
      columns: {
        a!columnLayout(
          a!textfield(
            label: &amp;quot;text1&amp;quot;,
            required: true,
            value: local!text1,
            saveInto: local!text1,
            validationGroup: if(
              len(local!text1) &amp;gt; 5,&amp;quot;submit save&amp;quot;,&amp;quot;submit&amp;quot;/*&amp;lt;&amp;lt;-- NOTE this*/
            )
            ,
            validations: {
              if(
                len(
                  local!text1
                ) &amp;gt; 5,
                &amp;quot;cannot be greater than 5&amp;quot;,
                null
              )
            }
          )
        ),
        a!columnLayout(
          a!textfield(
            label: &amp;quot;texx2&amp;quot;,
            required: true,
            value: local!text2,
            saveInto: local!text2,
            validationGroup: if(
              len(local!text2) &amp;gt; 5,&amp;quot;submit save&amp;quot;,&amp;quot;submit&amp;quot;/*&amp;lt;&amp;lt;-- NOTE this*/
            )
            ,
            validations: {
              if(
                len(
                  local!text2
                ) &amp;gt; 5,
                &amp;quot;cannot be greater than 5&amp;quot;,
                null
              )
            }
          )
        )
      }
    ),
    validations: {},
    buttons: a!buttonlayout(
      primaryButtons: {
        
        a!buttonWidgetSubmit(
          label: &amp;quot;submit&amp;quot;,
          value: &amp;quot;submit&amp;quot;,
          style:&amp;quot;PRIMARY&amp;quot;,
          saveInto: ri!button,
          validationGroup: &amp;quot;submit&amp;quot;/*&amp;lt;&amp;lt;-- NOTE this*/
          
        )
      }, 
      secondaryButtons: a!buttonWidgetSubmit(
          label: &amp;quot;save&amp;quot;,
          value: &amp;quot;save&amp;quot;,
          style:&amp;quot;SECONDARY&amp;quot;,
          saveInto: ri!button,
          validationGroup: &amp;quot;save&amp;quot;/*&amp;lt;&amp;lt;-- NOTE this*/
          
        )
    )
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;BTW:&amp;nbsp;Take a look at&amp;nbsp;VimalKumars proposal which is a valid solution&amp;nbsp; It will depend on your use case but in those cases I prefer to have a generic message as a warning and add all the validations that you have on each field Like this.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt; a!validationMessage(
  message: &amp;quot;Please &amp;lt;Action&amp;gt; Phone Number &amp;lt;Something&amp;gt;&amp;quot;,/* &amp;lt; -- Note this*/
  validateAfter: &amp;quot;SUBMIT&amp;quot;,
  showWhen: or(
    isnull(
      ri!phoneNumber
    ),
    trim(
      ri!phoneNumber
    ) = &amp;quot;&amp;quot;,
    len(ri!phoneNumber) &amp;gt; 10 /* &amp;lt; -- Note this*/
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Jose&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to skip required fields but not the custom validations of fields with a press of button?</title><link>https://community.appian.com/thread/57182?ContentTypeID=1</link><pubDate>Wed, 27 Jun 2018 00:00:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:022efc39-ea2c-4dec-8090-73425ce2ed7d</guid><dc:creator>vimalkumars</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;mohits0001,&lt;/p&gt;
&lt;p&gt;Try the below code. Here the required validation is added to the section layout&amp;nbsp; on SUBMIT&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!formLayout(
  label: &amp;quot;Allow Save&amp;quot;,
  contents: {
    a!sectionLayout(
      contents: a!columnsLayout(
        columns: {
          a!columnLayout(
            contents: {
              a!textField(
                label: &amp;quot;Name *&amp;quot;,
                labelPosition: &amp;quot;ABOVE&amp;quot;,
                value: ri!name,
                saveInto: ri!name,
                refreshAfter: &amp;quot;UNFOCUS&amp;quot;,
                validations: {
                  if(
                    len(
                      ri!name
                    ) &amp;gt; 50,
                    &amp;quot;Name cannot have more than 50 Characters&amp;quot;,
                    &amp;quot;&amp;quot;
                  )
                }
              )
            }
          ),
          a!columnLayout(
            contents: {
              a!textField(
                label: &amp;quot;Phone Number *&amp;quot;,
                labelPosition: &amp;quot;ABOVE&amp;quot;,
                value: ri!phoneNumber,
                saveInto: ri!phoneNumber,
                refreshAfter: &amp;quot;UNFOCUS&amp;quot;,
                validations: {
                  if(
                    len(
                      ri!phoneNumber
                    ) &amp;gt; 10,
                    &amp;quot;Phone Number cannot have more than 10 Characters&amp;quot;,
                    &amp;quot;&amp;quot;
                  )
                }
              )
            }
          )
        }
      ),
      validations: {
        a!validationMessage(
          message: &amp;quot;Name is required to submit&amp;quot;,
          validateAfter: &amp;quot;SUBMIT&amp;quot;,
          showWhen: or(
            isnull(
              ri!name
            ),
            trim(
              ri!name
            ) = &amp;quot;&amp;quot;
          )
        ),
        a!validationMessage(
          message: &amp;quot;Phone Number is required to submit&amp;quot;,
          validateAfter: &amp;quot;SUBMIT&amp;quot;,
          showWhen: or(
            isnull(
              ri!phoneNumber
            ),
            trim(
              ri!phoneNumber
            ) = &amp;quot;&amp;quot;
          )
        )
      },
      validationGroup: &amp;quot;SUBMIT&amp;quot;
    )
  },
  buttons: a!buttonLayout(
    primaryButtons: {
      a!buttonWidgetSubmit(
        label: &amp;quot;Submit&amp;quot;,
        validationGroup: &amp;quot;SUBMIT&amp;quot;,
        style: &amp;quot;PRIMARY&amp;quot;
      ),
      a!buttonWidgetSubmit(
        label: &amp;quot;Save&amp;quot;,
        saveInto: {},
        style: &amp;quot;NORMAL&amp;quot;
      )
    }
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to skip required fields but not the custom validations of fields with a press of button?</title><link>https://community.appian.com/thread/57156?ContentTypeID=1</link><pubDate>Tue, 26 Jun 2018 09:12:11 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:61006238-fb12-4e87-b9ff-fbf0b2f239c5</guid><dc:creator>mohitshah</dc:creator><description>&lt;p&gt;Hi Jose,&lt;/p&gt;
&lt;p&gt;I could use validationgroups if both required= true() and custom validations are not used for the same fields.&lt;/p&gt;
&lt;p&gt;As for my case all the fields are mandatory in the interface and also almost all have a validation for their length of 255 chars.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;This is my primary requirement&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1)&lt;/strong&gt; There is a button to save which is a secondary button for which i want to skip the required = true() validation but not the custom validation of length&amp;lt;=255 chars.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2)&lt;/strong&gt; I want all the validation, required=true() and length validation to trigger when the submit primary button is triggered.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m unable to satisfy the 1) requirement using validationgroups because the same field has both the validations&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to skip required fields but not the custom validations of fields with a press of button?</title><link>https://community.appian.com/thread/57145?ContentTypeID=1</link><pubDate>Tue, 26 Jun 2018 07:22:13 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:06995454-641d-46ce-9ac2-ea50c4ed0d0a</guid><dc:creator>josep</dc:creator><description>&lt;p&gt;Hello Mohits&lt;/p&gt;
&lt;p&gt;Look at the link shared by Shiva. One of the not well documented but powerful this mentioned in that thread is that you can actually use the validationGroup for multiple buttons just like this :&lt;/p&gt;
&lt;p&gt;validationGroup:&amp;quot;button1 button2&amp;quot;&lt;/p&gt;
&lt;p&gt;take a look at this example It might help you&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;load(
  local!button1,
  local!button2,
  local!text1,
  local!text2,
  a!formLayout(
    contents: a!columnsLayout(
      columns: {
        a!columnLayout(
          a!textfield(
            label: &amp;quot;text1&amp;quot;,
            required: true,
            value: local!text1,
            saveInto: local!text1,
            validationGroup: &amp;quot;button1&amp;quot;/*&amp;lt;&amp;lt;-- NOTE this*/
            
          )
        ),
        a!columnLayout(
          a!textfield(
            label: &amp;quot;texx2&amp;quot;,
            required: true,
            value: local!text2,
            saveInto: local!text2,
            validationGroup: &amp;quot;button1 button2&amp;quot;/*&amp;lt;&amp;lt;-- NOTE this*/
            
          )
        )
      }
    ),
    buttons: a!buttonlayout(
      primaryButtons: {
        a!buttonWidgetSubmit(
          label: &amp;quot;button1&amp;quot;,
          value: true,
          saveInto: local!button1,
          /*skipvalidation: true*//*&amp;lt;&amp;lt;-- NOTE this*/
          validationGroup: &amp;quot;button1&amp;quot;/*&amp;lt;&amp;lt;-- NOTE this*/
          
        ),
        a!buttonWidgetSubmit(
          label: &amp;quot;button2&amp;quot;,
          value: false,
          saveInto: local!button2,
          validationGroup: &amp;quot;button2&amp;quot;/*&amp;lt;&amp;lt;-- NOTE this*/
          
        )
      }
    )
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Jose&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to skip required fields but not the custom validations of fields with a press of button?</title><link>https://community.appian.com/thread/57136?ContentTypeID=1</link><pubDate>Tue, 26 Jun 2018 06:40:36 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:dff84c8f-d1fc-4431-b259-7420ad0f800c</guid><dc:creator>shwetad</dc:creator><description>Hi &lt;a href="/members/mohits0001"&gt;mohitshah&lt;/a&gt; ,&lt;br /&gt;
&lt;br /&gt;
There are two ways by which you can achieve this &lt;br /&gt;
1) You can create expression rule which will validate your data for custom validations and it will return Boolean value true or false, if it &lt;br /&gt;
    returns true show the required error message in form validation or section validation field.&lt;br /&gt;
2) Second is after you click on secondary button, in process model you can check for the data and based on your validation, set error &lt;br /&gt;
    message and redirect it to screen again with that error message.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to skip required fields but not the custom validations of fields with a press of button?</title><link>https://community.appian.com/thread/57130?ContentTypeID=1</link><pubDate>Tue, 26 Jun 2018 05:42:01 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5d4b6c9c-ae3f-4032-a41e-08fb37cbb2d2</guid><dc:creator>Shiva Valusa</dc:creator><description>Hi mohits0001,&lt;br /&gt;
&lt;br /&gt;
Please go through below link to get the things to be done.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="https://community.appian.com/discussions/f/user-interface/12730/need-to-make-a-field-is-required-for-a-button-which-has-skipped-all-the-validation-including-this-field"&gt;community.appian.com/.../need-to-make-a-field-is-required-for-a-button-which-has-skipped-all-the-validation-including-this-field&lt;/a&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>