<?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>Issues with value and saveInto parameter in  a!checkboxfield()</title><link>https://community.appian.com/discussions/f/user-interface/33860/issues-with-value-and-saveinto-parameter-in-a-checkboxfield</link><description>In the code below, I am not able to save the selected values. If i am selecting multiple values for a single question than I am getting below error- 
 
 
 
 
 
 
 &amp;quot;Interface Definition: Expression evaluation error at function a!forEach [line 19]: Error</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Issues with value and saveInto parameter in  a!checkboxfield()</title><link>https://community.appian.com/thread/128810?ContentTypeID=1</link><pubDate>Fri, 02 Feb 2024 16:57:47 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a4f7362c-cda6-4cec-b07d-d3130065d74b</guid><dc:creator>Abhay Dalsaniya</dc:creator><description>&lt;p&gt;Did you check the Rule - &amp;quot;I&amp;quot; at line 27 ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with value and saveInto parameter in  a!checkboxfield()</title><link>https://community.appian.com/thread/128430?ContentTypeID=1</link><pubDate>Mon, 29 Jan 2024 19:33:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ab336b86-366b-499c-bd29-9eb3b5d5e066</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;It is clear. You have misconfigured a rule by passing in 2 parameters when it only accepts one. It is present on line 27.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with value and saveInto parameter in  a!checkboxfield()</title><link>https://community.appian.com/thread/128429?ContentTypeID=1</link><pubDate>Mon, 29 Jan 2024 19:31:08 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:dbc8d969-03c1-46a4-abca-db5f9091a827</guid><dc:creator>Jai_1441</dc:creator><description>&lt;p&gt;&lt;a href="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/13/8816.error1.png"&gt;/resized-image/__size/640x480/__key/communityserver-discussions-components-files/13/8816.error1.png&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with value and saveInto parameter in  a!checkboxfield()</title><link>https://community.appian.com/thread/128428?ContentTypeID=1</link><pubDate>Mon, 29 Jan 2024 19:27:06 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:57f6e655-ef7b-41ad-b0f2-d6d4cff2869b</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;Sorry, but this image doesn&amp;#39;t load for me. Can you try uploading it again?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with value and saveInto parameter in  a!checkboxfield()</title><link>https://community.appian.com/thread/128426?ContentTypeID=1</link><pubDate>Mon, 29 Jan 2024 19:25:00 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:172c3e3c-da5c-412e-909e-111e60cc282e</guid><dc:creator>Jai_1441</dc:creator><description>&lt;p&gt;thanks for your response. could you suggest me how to fix this error.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/13/error1.png" /&gt;&lt;/p&gt;
&lt;p&gt;Here I had selected 2 values and got this error.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with value and saveInto parameter in  a!checkboxfield()</title><link>https://community.appian.com/thread/128424?ContentTypeID=1</link><pubDate>Mon, 29 Jan 2024 18:50:49 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4c637bb4-7ac9-4b48-b75e-79081c040030</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;Firstly, the index function should have a third parameter which is the default value to return if the index isn&amp;#39;t present. Secondly, when using list/array/dictionary/map in save into, avoid using index. You should only use it in the value parameter.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And now, try verifying that the variable you are trying to save in accepts multiple values, and try wrapping your save!value in a!flatten() function.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with value and saveInto parameter in  a!checkboxfield()</title><link>https://community.appian.com/thread/128423?ContentTypeID=1</link><pubDate>Mon, 29 Jan 2024 18:41:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5a56ff5b-29b1-4283-b4ab-9c3f06886919</guid><dc:creator>Jai_1441</dc:creator><description>&lt;p&gt;I had used index() here &amp;amp; now am able to select multiple answers for a single question but if i select the answer for another question than the first selected answer gets vanished. Is there any way to resolve this and store all the selected values in local?&lt;/p&gt;
&lt;p&gt;updated code-&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;value: index(local!selectedAnswer.SelectedAnswer,local!currentQuestion),
saveInto: a!save(
                index(local!selectedAnswer.SelectedAnswer,local!currentQuestion),
                save!value
                ),&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with value and saveInto parameter in  a!checkboxfield()</title><link>https://community.appian.com/thread/128409?ContentTypeID=1</link><pubDate>Mon, 29 Jan 2024 16:32:43 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:98ba4e75-249c-4817-a105-df37165e751d</guid><dc:creator>Jai_1441</dc:creator><description>&lt;p&gt;Yes, I had checked all the rules multiple times and able to fetch correct values from all the rules used in this code.&lt;/p&gt;
&lt;p&gt;Is there anything needs to change in value or saveInto parameter?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with value and saveInto parameter in  a!checkboxfield()</title><link>https://community.appian.com/thread/128408?ContentTypeID=1</link><pubDate>Mon, 29 Jan 2024 16:31:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:40a0ffbc-a0b5-4698-9854-14437e6138bb</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Yeah, well .... I agree, but when you say &amp;quot;&lt;span&gt;not able to save the selected values&amp;quot;, I think the issue is more with what happens AFTER&amp;nbsp;the value is saved.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with value and saveInto parameter in  a!checkboxfield()</title><link>https://community.appian.com/thread/128406?ContentTypeID=1</link><pubDate>Mon, 29 Jan 2024 16:27:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7c8719bf-5ab0-4062-9990-f491140b9486</guid><dc:creator>Jai_1441</dc:creator><description>&lt;p&gt;Yes correct. thats why am saving the selected values using a!map() in rule&amp;nbsp;rule!MWJ_QE_MultiCorrectOption_SelectedAnswer() to return a list. But still not able to save the selected values.&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  
  local!count:count(split(rule!MWJ_qe_multiCorrect_fetchQuestion(),&amp;quot;;&amp;quot;)),
  local!selectedAnswer:
  a!forEach(
    items:enumerate(local!count),
    expression:

    a!map(
      /*Question:local!question[fv!index],*/
      SelectedAnswer:null,
      DummyAnswer:null
    )),
    local!selectedAnswer,
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with value and saveInto parameter in  a!checkboxfield()</title><link>https://community.appian.com/thread/128405?ContentTypeID=1</link><pubDate>Mon, 29 Jan 2024 16:22:22 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ba2a05ae-280a-4d54-b4cc-302deff8b9b9</guid><dc:creator>Konduru Chaitanya</dc:creator><description>&lt;p&gt;Yes, I meant running your expression rule&amp;nbsp;or the iterations. This helps you understand what&amp;#39;s going wrong in the locals.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with value and saveInto parameter in  a!checkboxfield()</title><link>https://community.appian.com/thread/128404?ContentTypeID=1</link><pubDate>Mon, 29 Jan 2024 16:21:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:eb64bbcc-04b3-4336-8b31-5f6ca02da056</guid><dc:creator>Jai_1441</dc:creator><description>&lt;p&gt;Actually am fetching the choice values &amp;amp; choice labels from DB. If I am taking it from local than it worked fine only.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with value and saveInto parameter in  a!checkboxfield()</title><link>https://community.appian.com/thread/128403?ContentTypeID=1</link><pubDate>Mon, 29 Jan 2024 16:21:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cb7e822e-44bc-4d3a-942a-8c4cc1f43300</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;I understand. The difference between a radiobuttonfield and a checkboxfield is, that checkboxes always return a list. That might break same related logic in your code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with value and saveInto parameter in  a!checkboxfield()</title><link>https://community.appian.com/thread/128402?ContentTypeID=1</link><pubDate>Mon, 29 Jan 2024 16:20:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:09166443-e66d-4886-896b-b90cf277f982</guid><dc:creator>Konduru Chaitanya</dc:creator><description>&lt;p&gt;I don&amp;#39;t see any error for the above code, other than having no context of the answer.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with value and saveInto parameter in  a!checkboxfield()</title><link>https://community.appian.com/thread/128401?ContentTypeID=1</link><pubDate>Mon, 29 Jan 2024 16:15:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f039948f-f065-4c8d-b7dd-c044be0c1e88</guid><dc:creator>Jai_1441</dc:creator><description>&lt;p&gt;I tried this same using a!map and it also worked perfectly fine.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(

  local!InputData: {
    a!map(
      Questions:&amp;quot;What is CDT&amp;quot;,
      Options:{
        &amp;quot;a&amp;quot;,
        &amp;quot;b&amp;quot;,
        &amp;quot;c&amp;quot;,
        &amp;quot;d&amp;quot;
      },
      Selected:null,
      CorrectAnswers:&amp;quot;b&amp;quot;
    ),
    a!map(
      Questions:&amp;quot;What is expression&amp;quot;,
      Options:{
        &amp;quot;e&amp;quot;,
        &amp;quot;f&amp;quot;,
        &amp;quot;g&amp;quot;,
        &amp;quot;h&amp;quot;
      },
      Selected:null,
      CorrectAnswers:&amp;quot;g&amp;quot;
    ),
    a!map(
      Questions:&amp;quot;What is Interface&amp;quot;,
      Options:{
        &amp;quot;i&amp;quot;,
        &amp;quot;j&amp;quot;,
        &amp;quot;k&amp;quot;,
        &amp;quot;l&amp;quot;
      },
      Selected:null,
      CorrectAnswers:&amp;quot;k&amp;quot;
    )
  },
  local!SelectedAnswers:local!InputData.selectedAnswers,
  /*local!CorrectAnswer:local!InputData.CorrectAnswers,*/
  /*local!Results:{intersection(local!CorrectAnswer,local!SelectedAnswers)},*/
  /*local!Score:length(local!Results),*/

  {
    a!sectionLayout(
      label: &amp;quot;Quize Paper&amp;quot;,

      contents: {

        a!forEach(
          items:local!InputData,
          expression: {
            a!checkboxField(
              choiceLabels: fv!item.Options,
              choiceValues: fv!item.Options,
              label: fv!item.Questions,
              labelPosition: &amp;quot;ABOVE&amp;quot;,
              value:fv!item.selectedAnswers,
              saveInto: {
                a!save(fv!item.selectedAnswers,save!value)
              },
              choiceLayout: &amp;quot;STACKED&amp;quot;,
              validations: {}
            )
          }
        )
      }
    ),
    a!richTextDisplayField(
      labelPosition: &amp;quot;COLLAPSED&amp;quot;,
      value: {
        /*local!Score*/
      }
    )
  }

)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with value and saveInto parameter in  a!checkboxfield()</title><link>https://community.appian.com/thread/128400?ContentTypeID=1</link><pubDate>Mon, 29 Jan 2024 16:15:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:83272962-71ee-4800-b1cc-94f498339812</guid><dc:creator>Konduru Chaitanya</dc:creator><description>&lt;p&gt;&amp;nbsp;Hello&amp;nbsp;&lt;a href="/members/jaydeom0001"&gt;Jai_1441&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Get the choice labels and choice values in a local. I would not recommend running it directly in the components.&lt;br /&gt;Then when you have the code, please do post it here as Stefan has mentioned for a better readability.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with value and saveInto parameter in  a!checkboxfield()</title><link>https://community.appian.com/thread/128399?ContentTypeID=1</link><pubDate>Mon, 29 Jan 2024 16:14:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8843f35c-81b5-49c9-b877-8088b975fba0</guid><dc:creator>Jai_1441</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!question: split(rule!MWJ_qe_multiCorrect_fetchQuestion(), &amp;quot;;&amp;quot;),
  local!option: split(rule!MWJ_qe_multipleCorect_options(), &amp;quot;;&amp;quot;),
  local!numberOfAnswers: 4,
  local!correctAnswer: rule!MWJ_qe_MultiCorrect_CorrectAnswer(),
  local!selectedAnswer: rule!MWJ_QE_MultiCorrectOption_SelectedAnswer(),
  local!Temp: stripwith(
    local!selectedAnswer.SelectedAnswer,
    &amp;quot;ZYWX[]:&amp;quot;
  ),
  /*local!result: intersection(local!correctAnswer, local!Temp),*/
  /*local!score: length(local!result),*/

  local!submit: false,
  {
    a!sectionLayout(
      label: &amp;quot;xxx&amp;quot;,
      contents: {
        a!forEach(
          items: local!question,
          expression: a!localVariables(
            local!currentQuestion: fv!index,
            {
              a!columnsLayout(
                columns: {
                  a!columnLayout(
                    contents: a!checkboxField(
                      choiceLabels: {
                        a!forEach(
                          items: enumerate(local!numberOfAnswers),
                          expression: index(
                            split(stripwith(local!option, &amp;quot;[]ZYWX:&amp;quot;), &amp;quot;,&amp;quot;),
                            if(
                              local!currentQuestion = 0,
                              fv!index,
                              fv!index + local!numberOfAnswers * (local!currentQuestion - 1)
                            )
                          )
                        )
                      },
                      choiceValues: {
                        a!forEach(
                          items: enumerate(local!numberOfAnswers),
                          expression: index(
                            split(local!option, &amp;quot;,&amp;quot;),
                            if(
                              local!currentQuestion = 0,
                              fv!item,
                              fv!index + local!numberOfAnswers * (local!currentQuestion - 1)
                            )
                          )
                        )
                      },
                      label: fv!index &amp;amp; &amp;quot;.  &amp;quot; &amp;amp; fv!item,
                      labelPosition: &amp;quot;ABOVE&amp;quot;,
                      value: local!selectedAnswer.SelectedAnswer[local!currentQuestion],
                      saveInto:
                      a!save(
                        local!selectedAnswer.SelectedAnswer[local!currentQuestion],
                        save!value
                      ),
                      validations: {}
                    )
                  )
                  
                },
                alignVertical: &amp;quot;TOP&amp;quot;
              ),
              a!sectionLayout(
                label: &amp;quot;&amp;quot;,
                contents: {
                  a!richTextDisplayField(
                    label: &amp;quot;Correct Answer : &amp;quot;,
                    labelPosition: &amp;quot;ABOVE&amp;quot;,
                    value: a!richTextItem(
                      text: {
                        a!forEach(
                          items: local!currentQuestion,
                          expression: index(
                            local!correctAnswer,
                            if(
                              local!currentQuestion = 0,
                              &amp;quot;&amp;quot;,
                              fv!index + 1 * (local!currentQuestion - 1)
                            )
                          )
                        )

                      },
                      color: &amp;quot;POSITIVE&amp;quot;,
                      size: &amp;quot;MEDIUM&amp;quot;,
                      style: &amp;quot;EMPHASIS&amp;quot;
                    ),
                    showWhen: local!submit

                  )

                }
              )

            }

          )
        )
      },
      marginBelow: &amp;quot;STANDARD&amp;quot;

    ),
    /*a!timeDisplayField(*/
    /*label:&amp;quot;Time Lapsed&amp;quot;,*/
    /*value:time(now())*/
    /*),*/
    a!buttonArrayLayout(
      buttons: {
        a!buttonWidget(
          label: &amp;quot;Check Score&amp;quot;,
          icon: &amp;quot;thumbs-up&amp;quot;,
          iconPosition: &amp;quot;END&amp;quot;,
          saveInto: {

            /*a!save(local!submit, save!value),*/
            /*a!save(ri!score.score,local!score)*/
          },
          /*submit: true,*/

          style: &amp;quot;GHOST&amp;quot;
        ),
        a!buttonWidget(
          label:&amp;quot;close&amp;quot;,
          value:&amp;quot;close&amp;quot;,
          saveInto: ri!buttonAction,
          submit:true,
          style: &amp;quot;SOLID&amp;quot;


        )

      },
      align: &amp;quot;CENTER&amp;quot;

    ),
    a!sectionLayout(
      labelColor: &amp;quot;POSITIVE&amp;quot;,
      contents: {
        a!columnsLayout(
          columns: {
            a!columnLayout(
              contents: {
                a!richTextDisplayField(
                  labelPosition: &amp;quot;ADJACENT&amp;quot;,

                  value:{a!richTextItem(
                    text: &amp;quot;Your Score is  &amp;quot;,
                    color: &amp;quot;ACCENT&amp;quot;,
                    size: &amp;quot;LARGE&amp;quot;,
                    style: &amp;quot;STRONG&amp;quot;

                  ),
                  a!richTextItem(
                    /*text: { local!score },*/
                    color: &amp;quot;ACCENT&amp;quot;,
                    size: &amp;quot;LARGE&amp;quot;,
                    style: &amp;quot;STRONG&amp;quot;


                  )},
                  showWhen: local!submit,
                  marginAbove: &amp;quot;STANDARD&amp;quot;

                )
              }
            )

          }
        )
      },
      isInitiallyCollapsed: true,
      dividerWeight: &amp;quot;MEDIUM&amp;quot;,
      dividerColor: &amp;quot;ACCENT&amp;quot;,
      marginAbove: &amp;quot;STANDARD&amp;quot;
    )


  }
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with value and saveInto parameter in  a!checkboxfield()</title><link>https://community.appian.com/thread/128398?ContentTypeID=1</link><pubDate>Mon, 29 Jan 2024 16:09:22 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a985ec38-00a4-42a0-a8ae-b01331be04ac</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;I suggest to follow a structured problem solving approach. Reduce the code to the bare working/non-working minimum to understand what is going wrong. Then fix it and build back up to the final solution.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with value and saveInto parameter in  a!checkboxfield()</title><link>https://community.appian.com/thread/128397?ContentTypeID=1</link><pubDate>Mon, 29 Jan 2024 16:05:18 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f5c5335f-fb69-49eb-8730-4095db2054e2</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/13/pastedimage1706544316363v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>