<?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>Checkboxfield on user interface</title><link>https://community.appian.com/discussions/f/user-interface/24197/checkboxfield-on-user-interface</link><description>Hi, 
 My requirement is when I check one checkbox, another checkbox should uncheck(If checked already). 
 This functionality I am able to achieve with the attached code. 
 But, I am encountering an issue like, I was unable to &amp;quot;uncheck&amp;quot; the same selected</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Checkboxfield on user interface</title><link>https://community.appian.com/thread/93361?ContentTypeID=1</link><pubDate>Thu, 07 Apr 2022 16:13:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:29b2b1ef-a3b7-470a-ae39-ff07e5603f68</guid><dc:creator>Hari Kishore Reddy</dc:creator><description>&lt;p&gt;Thank you all for your advises. I really appreciate.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Checkboxfield on user interface</title><link>https://community.appian.com/thread/93330?ContentTypeID=1</link><pubDate>Thu, 07 Apr 2022 05:33:30 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d5305826-3854-49cf-957c-3d744bc14581</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;Shouldn&amp;#39;t be using a radio button instead of a checkBox field??&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Checkboxfield on user interface</title><link>https://community.appian.com/thread/93325?ContentTypeID=1</link><pubDate>Wed, 06 Apr 2022 22:29:35 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2c2d2510-4341-4226-8c8b-055c3f1812df</guid><dc:creator>Dimitris Soulovaris</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!additionalInfoRequired,
  local!cancelled,
  a!formLayout(
    contents: {
      a!checkboxField(
        labelPosition: &amp;quot;ABOVE&amp;quot;,
        choiceLabels: { &amp;quot;additional Info Required&amp;quot; },
        choiceValues: { true },
        value: if(
          local!cancelled,
          null,
          local!additionalInfoRequired
        ),
        saveInto: {
          a!save(
            local!additionalInfoRequired,
            if(local!additionalInfoRequired, null, true)
          ),
          a!save(
            local!cancelled,
            if(local!cancelled, false, null)
          )
        }
      ),
      a!checkboxField(
        labelPosition: &amp;quot;ABOVE&amp;quot;,
        choiceLabels: { &amp;quot;additional Info Required&amp;quot; },
        choiceValues: { true },
        value: if(
          local!additionalInfoRequired,
          null,
          local!cancelled
        ),
        saveInto: {
          a!save(
            local!cancelled,
            if(local!cancelled, null, true)
          ),
          a!save(
            local!additionalInfoRequired,
            if(local!additionalInfoRequired, false, null)
          )
        }
      )
    },
    buttons: a!buttonLayout(
      primaryButtons: {
        a!buttonWidget(label: &amp;quot;Submit&amp;quot;, submit: true)
      }
    )
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;My previous replies were marked as spams for a reason.. Nevermind.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m posting again the fixed version with the variables you had in your code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Checkboxfield on user interface</title><link>https://community.appian.com/thread/93324?ContentTypeID=1</link><pubDate>Wed, 06 Apr 2022 22:26:54 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9e6fa8b4-b5f4-4b28-b84e-9a13f76a7fe5</guid><dc:creator>Peter Lewis</dc:creator><description>&lt;p&gt;First to check - is it possible your paradigm can be met by using a dropdown or radio buttons? Those components already have a method of ensuring that only a single value is selected, so it might be easier than trying a more complicated solution with checkboxes.&lt;/p&gt;
&lt;p&gt;That being said, I have a couple recommendations for making this work with the checkbox method:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;First, I&amp;#39;d suggest using two different variables for each checkbox. It&amp;#39;s much easier to identify what&amp;#39;s happening and you can manage the variables independently.&lt;/li&gt;
&lt;li&gt;I also recommend avoiding logic on the &amp;quot;value&amp;quot; parameter - personally I find it much easier to always make the value reference a variable directly, because then there is no ambiguity for what is displayed. Then, you simply need to apply the correct logic on the save to ensure the value is correct.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here&amp;#39;s my solution:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!additionalInfoRequired,
  local!additionalInfoRequired2,
  a!formLayout(
    contents:{
      a!checkboxField(
        labelPosition: &amp;quot;ABOVE&amp;quot;,
        choiceLabels: {&amp;quot;additional Info Required&amp;quot;},
        choiceValues: {true},
        value: local!additionalInfoRequired,
        saveInto: {
          local!additionalInfoRequired,
          if(
            and(
              local!additionalInfoRequired,
              local!additionalInfoRequired2
            ),
            a!save(
              target: local!additionalInfoRequired2,
              value: null
            ),
            {}
          )
        }
      ),
      a!checkboxField(
        labelPosition: &amp;quot;ABOVE&amp;quot;,
        choiceLabels: {&amp;quot;additional Info Required 2&amp;quot;},
        choiceValues: {true},
        value: local!additionalInfoRequired2,
        saveInto: {
          local!additionalInfoRequired2,
          if(
            and(
              local!additionalInfoRequired,
              local!additionalInfoRequired2
            ),
            a!save(
              target: local!additionalInfoRequired,
              value: null
            ),
            {}
          )
        }
      )
    },
    buttons:a!buttonLayout(
      primaryButtons:{
        a!buttonWidget(
          label:&amp;quot;Submit&amp;quot;,
          submit: true
        )
      }
    )
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Checkboxfield on user interface</title><link>https://community.appian.com/thread/93322?ContentTypeID=1</link><pubDate>Wed, 06 Apr 2022 22:02:04 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:89a47aea-3c58-4e78-a284-3deffeba3410</guid><dc:creator>Hari Kishore Reddy</dc:creator><description>&lt;p&gt;If you double click on the same checkbox twice, it is returning an error.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Checkboxfield on user interface</title><link>https://community.appian.com/thread/93321?ContentTypeID=1</link><pubDate>Wed, 06 Apr 2022 21:59:47 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c5390232-b1c9-416f-b98c-95fd45f58214</guid><dc:creator>Dimitris Soulovaris</dc:creator><description>[deleted]&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>