<?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>Facing Issue with validation Group and required field.</title><link>https://community.appian.com/discussions/f/user-interface/19701/facing-issue-with-validation-group-and-required-field</link><description>I have a requirement where i have a field and 3 buttons. I have to make the field required(validation should come) on click of 2 button and not required (field is not validated)on click of the third button. The third button is having submit as false(</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Facing Issue with validation Group and required field.</title><link>https://community.appian.com/thread/77007?ContentTypeID=1</link><pubDate>Thu, 08 Oct 2020 03:17:41 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ef7c7c8e-ebbf-4380-ac81-67e25d8a4bad</guid><dc:creator>Siddharth</dc:creator><description>&lt;p&gt;Hey Srishti -&amp;nbsp;Did some minor updates to your code. Does this fulfill your needs?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!text1,
  local!buttonTxt,
  {
    a!sectionLayout(
      contents: {
        /*This is the only field for which i have to throw required validation when button A and B are clicked */
        /*and for button x this field should be not required
        Also for each button validate is true because they are validating other fields as well
        */
        a!textField(
          label: &amp;quot;Field 1&amp;quot;,
          required: true(),
          value: local!text1,
          saveInto: local!text1,
          validationGroup: &amp;quot;GroupX&amp;quot;
        ),
        a!buttonArrayLayout(
          align: &amp;quot;END&amp;quot;,
          buttons: {
            a!buttonWidget(
              label: &amp;quot;Button X&amp;quot;,
              style: &amp;quot;PRIMARY&amp;quot;,
              value: &amp;quot;ButtonX&amp;quot;,
              saveInto: local!buttonTxt,
              validate: true()
            )
          }
        ),
        a!buttonArrayLayout(
          align: &amp;quot;END&amp;quot;,
          buttons: {
            a!buttonWidget(
              label: &amp;quot;Button A&amp;quot;,
              value: &amp;quot;ButtonA&amp;quot;,
              saveInto: local!buttonTxt,
              submit: true(),
              /*Submit is true*/
              validate: true(),
              validationGroup: &amp;quot;GroupX&amp;quot;
            ),
            a!buttonWidget(
              label: &amp;quot;Button B&amp;quot;,
              style: &amp;quot;PRIMARY&amp;quot;,
              value: &amp;quot;ButtonB&amp;quot;,
              saveInto: local!buttonTxt,
              submit: true(),
              /*Submit is true*/
              validate: true(),
              validationGroup: &amp;quot;GroupX&amp;quot;
            )
          }
        )
      }
    )
  }
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Facing Issue with validation Group and required field.</title><link>https://community.appian.com/thread/77004?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2020 19:59:38 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4d0d90c3-45e1-49a1-b8dd-b109682e12d1</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Thanks for providing this - as I mentioned above accidentally in the wrong place, can you provide some further detail as to the behavior you&amp;#39;re expecting to see on this form, compared to what behavior you&amp;#39;re experiencing?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Facing Issue with validation Group and required field.</title><link>https://community.appian.com/thread/77001?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2020 19:23:35 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:aba54ac3-7363-48e0-9f75-5045dde7d2ea</guid><dc:creator>srishtim0001</dc:creator><description>&lt;p&gt;Thanks for all the help! Below is the snippet of code i am working on&lt;pre class="ui-code" data-mode="json"&gt;a!localVariables(
  local!text1,
  local!buttonTxt,
  {
    a!sectionLayout(
      contents: {
        /*This is the only field for which i have to throw required validation when button A and B are clicked */
        /*and for button x this field should be not required
        Also for each button validate is true because they are validating other fields as well
        */
        a!textField(
          label: &amp;quot;Field 1&amp;quot;,
          required: true(),
          value: local!text1,
          saveInto: local!text1
        ),
        a!buttonArrayLayout(
          align: &amp;quot;END&amp;quot;,
          buttons: {
            a!buttonWidget(
              label: &amp;quot;Button X&amp;quot;,
              style: &amp;quot;PRIMARY&amp;quot;,
              value: &amp;quot;ButtonX&amp;quot;,
              saveInto: local!buttonTxt,
              validate: true(),
              validationGroup: &amp;quot;GroupX&amp;quot;
            )
          }
        ),
        a!buttonArrayLayout(
          align: &amp;quot;END&amp;quot;,
          buttons: {
            a!buttonWidget(
              label: &amp;quot;Button A&amp;quot;,
              value: &amp;quot;ButtonA&amp;quot;,
              saveInto: local!buttonTxt,
              submit: true(),
              /*Submit is true*/
              validate: true(),
              validationGroup: &amp;quot;GroupA&amp;quot;
            ),
            a!buttonWidget(
              label: &amp;quot;Button B&amp;quot;,
              style: &amp;quot;PRIMARY&amp;quot;,
              value: &amp;quot;ButtonB&amp;quot;,
              saveInto: local!buttonTxt,
              submit: true(),
              /*Submit is true*/
              validate: true(),
              validationGroup: &amp;quot;GroupB&amp;quot;
            )
          }
        )
      }
    )
  }
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Facing Issue with validation Group and required field.</title><link>https://community.appian.com/thread/77000?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2020 19:09:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4545da19-b9be-417e-8969-67d05dcafe50</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Apologies, I wasn&amp;#39;t looking closely enough at who posted it.&amp;nbsp; Thanks for sharing - I agree this seems to follow her posted use case.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Facing Issue with validation Group and required field.</title><link>https://community.appian.com/thread/76998?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2020 19:02:39 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d88cc9c2-01a5-467e-92ed-7988738b58a1</guid><dc:creator>Siddharth</dc:creator><description>&lt;p&gt;I was just trying to fulfill the requirement posted by the user - Srishti.&lt;/p&gt;
&lt;p&gt;Hope this was what she was looking for.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Facing Issue with validation Group and required field.</title><link>https://community.appian.com/thread/76995?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2020 18:15:43 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5e95f512-9035-44f4-ad7e-b2fe201dfe68</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Thanks for the code snippet - can you clarify a bit more as to what behavior you&amp;#39;re hoping to see in this case, compared to the behavior we&amp;#39;re seeing?&amp;nbsp; When I try this on my end it does seem to correctly require Field 2 when &amp;quot;Button A&amp;quot; is pressed, but not &amp;quot;Button B&amp;quot;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Facing Issue with validation Group and required field.</title><link>https://community.appian.com/thread/76991?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2020 17:55:36 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6c1e0e06-a7da-4e6a-b838-60044f2c6884</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;There are other potential workarounds to this - such as, disabling a button under certain conditions, as well as form-level or section-level validations that don&amp;#39;t fire until Submitting is attempted.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Facing Issue with validation Group and required field.</title><link>https://community.appian.com/thread/76990?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2020 17:53:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:07d833e3-d136-4920-929c-7b3da67e6f7c</guid><dc:creator>Siddharth</dc:creator><description>&lt;p&gt;I tried implementing this via &amp;#39;validationGroup&amp;#39; and got a similar functionality working.&amp;nbsp; The text field &amp;#39;Field 2&amp;#39; doesn&amp;#39;t show the required indicator since it is optional if the user happens to click on Button B.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!text1,
  local!text2,
  {
    a!sectionLayout(
      contents: {
        a!textField(
          label: &amp;quot;Field 1&amp;quot;,
          required: true(),
          requiredMessage: &amp;quot;Required field validation&amp;quot;,
          value: local!text1,
          saveInto: local!text1
        ),
        a!textField(
          label: &amp;quot;Field 2&amp;quot;,
          required: true,
          requiredMessage: &amp;quot;Optional field validation&amp;quot;,
          validationGroup: &amp;quot;Group_1&amp;quot;,
          value: local!text2,
          saveInto: local!text2
        ),
        a!buttonArrayLayout(
          align: &amp;quot;END&amp;quot;,
          buttons: {
            a!buttonWidget(
              label: &amp;quot;Button A&amp;quot;,
              validate: true(),
              validationGroup: &amp;quot;Group_1&amp;quot;
            ),
            a!buttonWidget(label: &amp;quot;Button B&amp;quot;, validate: true())
          }
        )
      }
    )
  }
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Facing Issue with validation Group and required field.</title><link>https://community.appian.com/thread/76989?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2020 17:10:36 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9a614ab9-7979-4e1b-88f8-16ea177e60dd</guid><dc:creator>Shikha</dc:creator><description>&lt;p&gt;Can you post your code snippet here ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Facing Issue with validation Group and required field.</title><link>https://community.appian.com/thread/76988?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2020 17:09:37 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:01c12681-1ebe-48db-965b-52822341f855</guid><dc:creator>srishtim0001</dc:creator><description>&lt;p&gt;Thanks Mike for the reply. The 3rd button validates other fields hence i can&amp;#39;t keep the validate property of it as false.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Facing Issue with validation Group and required field.</title><link>https://community.appian.com/thread/76987?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2020 16:20:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a271b17b-45e9-449f-be91-bce98d6a7aad</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;I never really use &amp;quot;validationGroup&amp;quot; functionality since it doesn&amp;#39;t show &amp;quot;required&amp;quot; indicators on any fields that use it, and it never seems to work like I&amp;#39;d hope it would.&amp;nbsp; So you&amp;#39;re not alone here.&lt;/p&gt;
&lt;p&gt;In your example though, why can&amp;#39;t you just set the 3rd button to have a &amp;quot;validate&amp;quot; value of False?&lt;/p&gt;
&lt;p&gt;Do you have an example SAIL interface code you could post here and we can look at what isn&amp;#39;t working for you and look into solutions and/or workarounds?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>