<?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>Need checkbox to remain selected if set</title><link>https://community.appian.com/discussions/f/user-interface/26870/need-checkbox-to-remain-selected-if-set</link><description>I have this checkbox when checked sets the priority on the case. Currently the value is defaulted to 0. When its set the value updates from 0 to 100 and I should be able to check the value and if its 100 when the end user returns they will see the box</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Need checkbox to remain selected if set</title><link>https://community.appian.com/thread/105545?ContentTypeID=1</link><pubDate>Tue, 13 Dec 2022 22:25:50 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9333d3cd-e80b-4d6b-a589-e75da3aa2b48</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;No prob!&amp;nbsp; And just FYI, a long time ago I got tired of the manual finagling needed to make a checkbox like this handle a simple on/off switch, so I wrote a reusable custom component that I save in a generalized format and then call when needed.&amp;nbsp; I posted it a few years ago &lt;a href="/discussions/f/user-interface/18268/checkbox-false-value-not-being-saved/71896#71896"&gt;in this thread&lt;/a&gt; if you&amp;#39;d like to check it out - including explanations of how it works, etc.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need checkbox to remain selected if set</title><link>https://community.appian.com/thread/105544?ContentTypeID=1</link><pubDate>Tue, 13 Dec 2022 22:22:06 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3224471a-09a1-4a85-b5a4-81d01bd434ad</guid><dc:creator>seenaomi</dc:creator><description>&lt;p&gt;This is fantastic! I really appreciate the help - I&amp;#39;ve been mulling through docs trying to sort out the best way to achieve this. I should have came here much sooner. Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need checkbox to remain selected if set</title><link>https://community.appian.com/thread/105543?ContentTypeID=1</link><pubDate>Tue, 13 Dec 2022 22:12:25 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:20b1fccd-3bb3-4261-8d02-4c0d0587e2a5</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;PFA the attached somewhat-reworked sample code / portable interface (bypassing &amp;quot;local!case&amp;quot; and instead establishing an initial value that you can just switch between 0 and 100 to test both presets).&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;a!localVariables(
  
  /* change this value to either 0 or 100 by commenting or
      un-commenting the &amp;quot;0&amp;quot; row, then pressing &amp;quot;test&amp;quot; */
  local!testPriorityRank: {
    /*0,*/
    100
  }[1],
  
  local!choices: {100},
  
  local!checkboxCurrentValue: if(
    local!testPriorityRank = 100,
    {100},
    {}
  ),
  
  /* setting this value using local variable update chaining so you can pass it back to the process / etc to update your case priority rank value.  it doesn&amp;#39;t have any other function in this test interface. */
  local!updatePriorityRank: a!defaultValue(
    index(local!checkboxCurrentValue, 1, null()),
    0
  ),
  
  a!sectionLayout(
    label: &amp;quot;Case Priority&amp;quot;,
    contents: {
      a!checkboxField(
        label: &amp;quot;&amp;quot;,
        choiceLabels: {&amp;quot;Priority&amp;quot;},
        choiceValues: {local!choices},

        value: local!checkboxCurrentValue,
        saveInto: {
          local!checkboxCurrentValue
        },
        choiceStyle: &amp;quot;STANDARD&amp;quot;
      ),
      
      a!richTextDisplayField(
        label: &amp;quot;Evaluated Priority:&amp;quot;,
        value: a!richTextItem(
          text: local!updatePriorityRank,
          style: &amp;quot;EMPHASIS&amp;quot;
        )
      )
    }
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/13/pastedimage1670969585567v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/13/pastedimage1670969604944v2.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need checkbox to remain selected if set</title><link>https://community.appian.com/thread/105541?ContentTypeID=1</link><pubDate>Tue, 13 Dec 2022 21:55:04 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:50230f93-cdc5-4a5b-be72-229707997f02</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;So the first problem you&amp;#39;re facing here is, the checkbox field doesn&amp;#39;t work as straight-forwardly as what you&amp;#39;re attempting.&amp;nbsp; This is understandable, it&amp;#39;s not the easiest thing to understand especially when you&amp;#39;re trying to use it as a boolean (and really it&amp;#39;s not meant to be used that way, though it *can*).&lt;/p&gt;
&lt;p&gt;The checkbox field &lt;strong&gt;always assumes&lt;/strong&gt; a LIST of items will be provided, and a LIST of values (down to an empty list) will be the VALUE.&lt;/p&gt;
&lt;p&gt;In your case, you&amp;#39;re passing a hardcoded list of a single label (Priority) accompanied by a semi-hardcoded list of a single value (choices, so either 0 or 100).&amp;nbsp; But your saveInto is not making any accounting for what you&amp;#39;re actually trying to accomplish - that is, switching between 0 or 100.&amp;nbsp; You&amp;#39;ll need to do a bit more bending over backwards first.&lt;/p&gt;
&lt;p&gt;The second problem here is, your local variable (the aforementioned value and save target) is not making any reference to the current value of &lt;em&gt;local!case&lt;/em&gt; upon form load.&amp;nbsp; So as I mentioned before, it will always load blank.&amp;nbsp; The way the checkbox field works, when you pass in a blank value as the value of the list of the checkboxValues list (regardless of what the valid values list contains), it&amp;#39;ll populate the checkbox as empty.&lt;/p&gt;
&lt;p&gt;Stand by and I&amp;#39;ll try to whip up a code snippet with things rearranged in such a way that they work more as you&amp;#39;re expecting here, and you might see what I mean.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need checkbox to remain selected if set</title><link>https://community.appian.com/thread/105539?ContentTypeID=1</link><pubDate>Tue, 13 Dec 2022 21:49:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f1909f79-0513-4c57-8c3a-75b77f80cd7a</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Sorry, not meaning to sound snippy or anything, it&amp;#39;s just often a struggle to discern the intent based on the limited amount of detail available in posts like this.&lt;/p&gt;
&lt;p&gt;I think I see what you&amp;#39;re getting at now - let me take a stab at it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need checkbox to remain selected if set</title><link>https://community.appian.com/thread/105538?ContentTypeID=1</link><pubDate>Tue, 13 Dec 2022 21:45:51 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2919cd87-9828-4f6b-b33b-da8f0b079aae</guid><dc:creator>seenaomi</dc:creator><description>&lt;p&gt;I&amp;nbsp;stated what I was trying to figure out how to&amp;nbsp;accomplish behavior wise and that I was struggling to find a way to do it. I provided my code to show my setup for guidance. Is that not the point of this forum?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need checkbox to remain selected if set</title><link>https://community.appian.com/thread/105535?ContentTypeID=1</link><pubDate>Tue, 13 Dec 2022 21:40:58 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4c3fb26a-5fda-41ad-bbf3-60d6a1dbc25a</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;You&amp;#39;re initializing that local variable to a hardcoded value of &lt;em&gt;&lt;strong&gt;null&lt;/strong&gt;&lt;/em&gt;.&amp;nbsp; The checkbox field uses that local variable for its &lt;em&gt;value&lt;/em&gt; and &lt;em&gt;saveInto&lt;/em&gt; parameters.&amp;nbsp; I&amp;#39;m not clear what you were expecting it to do, but under this setup, it will only &lt;em&gt;ever&lt;/em&gt; initialize to a state of unchecked.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need checkbox to remain selected if set</title><link>https://community.appian.com/thread/105534?ContentTypeID=1</link><pubDate>Tue, 13 Dec 2022 21:39:39 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e36b93c4-d622-4f1b-bf2c-5f744c6d31f5</guid><dc:creator>seenaomi</dc:creator><description>&lt;p&gt;Care to expand on that a bit ? Removing the null does nothing to resolve the issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need checkbox to remain selected if set</title><link>https://community.appian.com/thread/105531?ContentTypeID=1</link><pubDate>Tue, 13 Dec 2022 21:31:25 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1c8aaf77-2218-4d93-a856-2563ba3c9429</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;I mean, your problem is right there...&lt;br /&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/13/pastedimage1670967149404v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>