<?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>Required fields, if other field is empty</title><link>https://community.appian.com/discussions/f/general/14338/required-fields-if-other-field-is-empty</link><description>So I am very new at Appian and I have a question about required fields. 
 I have an interface with two sections: 
 In one section is just a field where one can enter an ID number. 
 The other section consists of several fields that are required, if the</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Required fields, if other field is empty</title><link>https://community.appian.com/thread/64611?ContentTypeID=1</link><pubDate>Wed, 13 Feb 2019 07:56:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:269bd6c0-ed6b-44a2-beff-4407775cd2b7</guid><dc:creator>christianr0002</dc:creator><description>thank you so much all of you. I really appreciate the help&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Required fields, if other field is empty</title><link>https://community.appian.com/thread/64589?ContentTypeID=1</link><pubDate>Tue, 12 Feb 2019 11:49:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:257676bf-e27f-48e2-8ea3-90a78149193a</guid><dc:creator>amitb0004</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;load(
  local!id,
  {
    a!sectionLayout(
      label: &amp;quot;Section1&amp;quot;,
      contents: {
        a!textField(
          label: &amp;quot;Text&amp;quot;,
          labelPosition: &amp;quot;ABOVE&amp;quot;,
          value: local!id,
          saveInto: local!id,
          refreshAfter: &amp;quot;UNFOCUS&amp;quot;,
          validations: {}
        )
      }
    ),
    a!sectionLayout(
      label: &amp;quot;Section2&amp;quot;,
      contents: {
        a!textField(
          label: &amp;quot;Text1&amp;quot;,
          labelPosition: &amp;quot;ABOVE&amp;quot;,
          saveInto: {},
          refreshAfter: &amp;quot;UNFOCUS&amp;quot;,
          required: isnull(
            local!id
          ),
          validations: {}
        )
      }
    ),
    a!textField(
      label: &amp;quot;Text2&amp;quot;,
      labelPosition: &amp;quot;ABOVE&amp;quot;,
      saveInto: {},
      required: isnull(
        local!id
      ),
      refreshAfter: &amp;quot;UNFOCUS&amp;quot;,
      validations: {}
    )
  }
)&lt;/pre&gt;Hi christianr0002,&lt;/p&gt;
&lt;p&gt;Save value of ID in some local variable and compare that variable in &amp;quot;required&amp;quot; property of second section fields by using isnull() function if &amp;nbsp;local variable is null then return true fro &amp;quot;required&amp;quot; property otherwise false...&lt;/p&gt;
&lt;p&gt;in this way you can handle the situation....&lt;/p&gt;
&lt;p&gt;Refer the following code...&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;load(
  local!id,
  {
    a!sectionLayout(
      label: &amp;quot;Section&amp;quot;,
      contents: {
        a!textField(
          label: &amp;quot;Text&amp;quot;,
          labelPosition: &amp;quot;ABOVE&amp;quot;,
          value: local!id,
          saveInto: local!id,
          refreshAfter: &amp;quot;UNFOCUS&amp;quot;,
          validations: {}
        )
      }
    ),
    a!sectionLayout(
      label: &amp;quot;Section&amp;quot;,
      contents: {
        a!textField(
          label: &amp;quot;Text1&amp;quot;,
          labelPosition: &amp;quot;ABOVE&amp;quot;,
          saveInto: {},
          refreshAfter: &amp;quot;UNFOCUS&amp;quot;,
          required: isnull(
            local!id
          ),
          validations: {}
        )
      }
    ),
    a!textField(
      label: &amp;quot;Text2&amp;quot;,
      labelPosition: &amp;quot;ABOVE&amp;quot;,
      saveInto: {},
      required: isnull(
        local!id
      ),
      refreshAfter: &amp;quot;UNFOCUS&amp;quot;,
      validations: {}
    )
  }
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;see the out put of above code as...&lt;/p&gt;
&lt;p&gt;when id is null&lt;/p&gt;
&lt;p&gt;&lt;a href="/cfs-file/__key/communityserver-discussions-components-files/11/8524.1.PNG"&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/11/8524.1.PNG" alt=" " /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;when id is not null&lt;/p&gt;
&lt;p&gt;&lt;a href="/cfs-file/__key/communityserver-discussions-components-files/11/2248.2.PNG"&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/11/2248.2.PNG" alt=" " /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thanks and Regards,&lt;/p&gt;
&lt;p&gt;Amit Behere&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Required fields, if other field is empty</title><link>https://community.appian.com/thread/64588?ContentTypeID=1</link><pubDate>Tue, 12 Feb 2019 11:32:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:55d2ec8b-6a78-4f03-babe-d7dc47a15c18</guid><dc:creator>adityae0002</dc:creator><description>Have made some modifications in the code provided by Yoga. &lt;br /&gt;
&lt;br /&gt;
     load(&lt;br /&gt;
  local!isRequired,&lt;br /&gt;
 local!val1,&lt;br /&gt;
  local!val2,&lt;br /&gt;
  a!formLayout(&lt;br /&gt;
  contents: {&lt;br /&gt;
a!sectionLayout(&lt;br /&gt;
  contents: {&lt;br /&gt;
    a!textField(&lt;br /&gt;
      label: &amp;quot;Test1&amp;quot;,&lt;br /&gt;
      value:local!val1,&lt;br /&gt;
      saveInto: {local!val1,&lt;br /&gt;
      if(isnull(local!val1),&lt;br /&gt;
      a!save(local!isRequired,null),&lt;br /&gt;
      a!save(local!isRequired,true())&lt;br /&gt;
      )&lt;br /&gt;
      &lt;br /&gt;
      },&lt;br /&gt;
      refreshAfter: &amp;quot;UNFOCUS&amp;quot;&lt;br /&gt;
    )&lt;br /&gt;
  }&lt;br /&gt;
),&lt;br /&gt;
a!sectionLayout(&lt;br /&gt;
  contents: {&lt;br /&gt;
    a!textField(&lt;br /&gt;
      label: &amp;quot;Test2&amp;quot;,&lt;br /&gt;
      value: local!val2,&lt;br /&gt;
      saveInto: local!val2,&lt;br /&gt;
      required: if(local!isRequired,false,true),&lt;br /&gt;
      refreshAfter: &amp;quot;UNFOCUS&amp;quot;&lt;br /&gt;
      &lt;br /&gt;
    )&lt;br /&gt;
  }&lt;br /&gt;
)&lt;br /&gt;
}&lt;br /&gt;
)&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
This will help you. Try it out!!&lt;br /&gt;
&lt;br /&gt;
Thanks,&lt;br /&gt;
Aditya.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Required fields, if other field is empty</title><link>https://community.appian.com/thread/64587?ContentTypeID=1</link><pubDate>Tue, 12 Feb 2019 10:11:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:72197f4a-1283-4b49-9554-4142eac55af7</guid><dc:creator>yogalakshmia962829</dc:creator><description>With the help of local variable you can achieve this.&lt;br /&gt;
Here is the sample code..&lt;br /&gt;
&lt;br /&gt;
load(&lt;br /&gt;
  local!isRequired,&lt;br /&gt;
  a!textField(&lt;br /&gt;
    label: &amp;quot;ID&amp;quot;,&lt;br /&gt;
    saveInto: {&lt;br /&gt;
      a!save(&lt;br /&gt;
        local!isRequired,&lt;br /&gt;
        true  /*With Required Condition*/&lt;br /&gt;
      )&lt;br /&gt;
    }&lt;br /&gt;
  ),&lt;br /&gt;
  a!textField(&lt;br /&gt;
    label: &amp;quot;Other Field(s)&amp;quot;,&lt;br /&gt;
    required: if(&lt;br /&gt;
      local!isRequired=true(),&lt;br /&gt;
      true,&lt;br /&gt;
      false&lt;br /&gt;
    )&lt;br /&gt;
  )&lt;br /&gt;
)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>