<?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>Checkbox False Value Not being saved</title><link>https://community.appian.com/discussions/f/user-interface/18268/checkbox-false-value-not-being-saved</link><description>Hi, 
 I have checked all the posts for how to capture the values from a checkbox and save it to an output CDT data element, but nothing has worked. 
 In my form, I have the following checkbox code where the only thing I want to do is if checked the value</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Checkbox False Value Not being saved</title><link>https://community.appian.com/thread/71896?ContentTypeID=1</link><pubDate>Wed, 05 Feb 2020 13:18:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1ec3b095-f50b-45cc-8924-6374ed3b1401</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;I see you had a working solution suggested already, but I figured I would chip in with my experience in case it helps you or anyone else.&lt;/p&gt;
&lt;p&gt;So, the basic fact here is that &lt;em&gt;a!checkboxField()&lt;/em&gt; wasn&amp;#39;t&amp;nbsp;&lt;em&gt;&lt;strong&gt;really&lt;/strong&gt;&lt;/em&gt;&lt;strong&gt;&lt;/strong&gt; made to handle a simple boolean (yes/no) selection at all.&amp;nbsp; It can be done but it requires a bit of legwork.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To deal with this, a few years ago I went ahead and created a &amp;quot;boolean checkbox&amp;quot; interface to serve as a shortcut&amp;nbsp;- the extra legwork is handled internally so that when it&amp;#39;s called, you only need to pass in some specific things to get it working:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;trueValue&lt;/strong&gt;: the value you want saved into your target variable when the box is checked&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;falseValue&lt;/strong&gt;: the value it should get when the box is un-checked (note: this can be anything, but it will require the user to check and un-check the box to get this value)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;value&lt;/strong&gt;: this is the primary save target, as well as the source of what the checkbox should display (i.e. whether it will appear checked or unchecked).&amp;nbsp; Initially it should be equal to the value of either trueValue or falseValue (or null). If set to anything other than these choices, the checkbox will also appear unchecked.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;checkboxLabel&lt;/strong&gt; &lt;em&gt;-or-&lt;/em&gt; &lt;strong&gt;label&lt;/strong&gt;: i typically leave &amp;quot;label&amp;quot; blank and set &amp;quot;checkboxLabel&amp;quot; to a value which then appears to the right of the checkbox&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;/* GLBL_Component_BooleanCheckbox */
a!checkboxField(
  label: ri!label,
  choiceLabels: { ri!checkboxLabel },
  choiceValues: { ri!trueValue },
  value: if(
    ri!value = ri!trueValue,
    ri!value,
    null()
  ),
  saveInto: {
    a!save(
      ri!value,
      if(isnull(save!value), ri!falseValue, ri!trueValue)
    )
  },
  
  /* optional standard parameters: */
  labelPosition: ri!labelPosition,
  instructions: ri!instructions,
  helpTooltip: ri!helpTooltip,
  required: ri!required,
  requiredMessage: ri!requiredMessage,
  accessibilityText: ri!accessibilityText,
  disabled: ri!readOnly,
  validations: ri!validations,
  align: ri!align,
  showWhen: ri!showWhen
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;All the other rule inputs are optional, and just allow the component to act more like the regular checkboxField when desired (labelPosition, instructions, validations, etc.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Checkbox False Value Not being saved</title><link>https://community.appian.com/thread/71891?ContentTypeID=1</link><pubDate>Tue, 04 Feb 2020 22:25:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:79d0c682-2f53-4e6f-a4c3-9871b3449d75</guid><dc:creator>robertab0001</dc:creator><description>&lt;p&gt;It worked!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Should I remove the if condition from the saveInto attribute in the checkbox component?&lt;/p&gt;
&lt;p&gt;Thank you so much!&lt;/p&gt;
&lt;p&gt;Roberta&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Checkbox False Value Not being saved</title><link>https://community.appian.com/thread/71890?ContentTypeID=1</link><pubDate>Tue, 04 Feb 2020 22:16:51 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4645ec6e-7eb4-40c9-8f80-f85568fd3c2e</guid><dc:creator>Karina Vazquez</dc:creator><description>&lt;p&gt;Oh, I understand, try&amp;nbsp;changing&amp;nbsp;the save in the buttonWidget with a if in the value:&lt;br /&gt;a!save(&lt;br /&gt;&lt;span&gt;ri!requests.requirements&lt;/span&gt;,&lt;br /&gt; if(&lt;br /&gt; isnull(local!reqdoc),&lt;br /&gt; false,&lt;br /&gt; true&lt;br /&gt; )&lt;br /&gt; )&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Checkbox False Value Not being saved</title><link>https://community.appian.com/thread/71889?ContentTypeID=1</link><pubDate>Tue, 04 Feb 2020 22:11:41 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a58cba2d-a933-4eee-a071-1e33a1ce8ff2</guid><dc:creator>robertab0001</dc:creator><description>&lt;p&gt;Thanks, &lt;a href="/members/karinav843"&gt;Karina Vazquez&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I would like to have one checkbox instead of two (yes/no) and not a radio button at all. The reason is because the user will have to select other checkboxes within my form. Each option is a Boolean value in my database.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t want to save value as null but true or false as a Boolean value.&lt;/p&gt;
&lt;p&gt;Roberta&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Checkbox False Value Not being saved</title><link>https://community.appian.com/thread/71888?ContentTypeID=1</link><pubDate>Tue, 04 Feb 2020 21:58:47 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e9551a7c-0dc3-4368-91ff-31b445c95872</guid><dc:creator>Karina Vazquez</dc:creator><description>&lt;p&gt;Hi Roberta,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The reason is because only exists the value true in your check box, (&lt;span&gt;choiceValues: {true},)&amp;nbsp;&lt;/span&gt;if you want to save a true/false I recommended you to use a radio button&lt;/p&gt;
&lt;p&gt;a!radioButtonField(&lt;br /&gt; label: &amp;quot;Requirements documentation&amp;quot;,&lt;br /&gt; labelPosition: &amp;quot;ABOVE&amp;quot;,&lt;br /&gt; choiceLabels: {&amp;quot;true&amp;quot;,&amp;quot;false&amp;quot;},&lt;br /&gt; choiceValues: {true,false},&lt;br /&gt; value: if(local!reqdoc, true, null),&lt;br /&gt; saveInto: a!save(local!reqdoc, if(isnull(save!value), false, true))&lt;br /&gt; )&lt;/p&gt;
&lt;p&gt;or change de save to allow to save a null value,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;a!checkboxField(&lt;br /&gt; label: &amp;quot;&amp;quot;,&lt;br /&gt; labelPosition: &amp;quot;ABOVE&amp;quot;,&lt;br /&gt; choiceLabels: {&amp;quot;Requirements documentation&amp;quot;},&lt;br /&gt; choiceValues: {true},&lt;br /&gt; value: if(local!reqdoc, true, null),&lt;br /&gt; saveInto: a!save(local!reqdoc, if(isnull(save!value), null, true))&lt;br /&gt; ),&lt;/p&gt;
&lt;p&gt;&lt;span class="tlid-translation translation" lang="en"&gt;&lt;span class="" title=""&gt;I hope the information is helpful&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="tlid-translation translation" lang="en"&gt;&lt;span class="" title=""&gt;Regards&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>