<?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>Unable to save local variable to rule input</title><link>https://community.appian.com/discussions/f/data/21692/unable-to-save-local-variable-to-rule-input</link><description>I am trying to save local!doctorsList.doctorName to ri!docName, local!doctorsList.doctor.doctorDept to ri!docDept and local!doctorsList.doctorVisit to ri!docVisit. However nothing is being saved into the rule inputs. I am able to display the value of</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Unable to save local variable to rule input</title><link>https://community.appian.com/thread/86713?ContentTypeID=1</link><pubDate>Thu, 07 Oct 2021 02:54:11 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4a1f7d75-90cb-4d46-bc31-81829aef4fd2</guid><dc:creator>SreeHarshaK</dc:creator><description>&lt;p&gt;yes this&amp;nbsp; helps&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unable to save local variable to rule input</title><link>https://community.appian.com/thread/84834?ContentTypeID=1</link><pubDate>Sun, 22 Aug 2021 23:57:39 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:570e239d-34e2-4202-b6d4-5f8d54eeab9b</guid><dc:creator>Acacio Barrado</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;a href="/members/roberte0002"&gt;robertellia&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;The fact that you are able to display the values in the field does not automatically save it in your rule inputs, so your save into option in your read only text fields will not help. In your scenario, you should add a save into in your submit button.&lt;/p&gt;
&lt;p&gt;As I did not have the results of your query, I changed a little your code in order to create an example. As the label was called list, but the way how you were displaying was single item I also changed that. I changed the rule inputs to array and also have added a new rule input type MAP.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/16/pastedimage1629676535868v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;It is not a final solution but will give you some ideas, please refer to the code below:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!dept: {
    &amp;quot;Gynecologist&amp;quot;,
    &amp;quot;Pediatrician&amp;quot;,
    &amp;quot;Psychiatrist&amp;quot;,
    &amp;quot;General Surgeon&amp;quot;,
    &amp;quot;Cardiac Surgeon&amp;quot;
  },
  local!doctorsFullList: {
    a!map(
      doctorDept: &amp;quot;Gynecologist&amp;quot;,
      doctorName: &amp;quot;Gynecologist 1&amp;quot;,
      doctorVisit: todate(today())
    ),
    a!map(
      doctorDept: &amp;quot;Gynecologist&amp;quot;,
      doctorName: &amp;quot;Gynecologist 2&amp;quot;,
      doctorVisit: todate(today() - 2)
    ),
    a!map(
      doctorDept: &amp;quot;Gynecologist&amp;quot;,
      doctorName: &amp;quot;Gynecologist 3&amp;quot;,
      doctorVisit: todate(today() - 3)
    ),
    a!map(
      doctorDept: &amp;quot;Pediatrician&amp;quot;,
      doctorName: &amp;quot;Pediatrician 1&amp;quot;,
      doctorVisit: todate(today())
    ),
    a!map(
      doctorDept: &amp;quot;Pediatrician&amp;quot;,
      doctorName: &amp;quot;Pediatrician 2&amp;quot;,
      doctorVisit: todate(today() - 2)
    ),
    a!map(
      doctorDept: &amp;quot;Psychiatrist&amp;quot;,
      doctorName: &amp;quot;Psychiatrist 1&amp;quot;,
      doctorVisit: todate(today())
    ),
    a!map(
      doctorDept: &amp;quot;General Surgeon&amp;quot;,
      doctorName: &amp;quot;General Surgeon 1&amp;quot;,
      doctorVisit: todate(today())
    ),
    a!map(
      doctorDept: &amp;quot;General Surgeon&amp;quot;,
      doctorName: &amp;quot;General Surgeon 2&amp;quot;,
      doctorVisit: todate(today() - 2)
    ),
    a!map(
      doctorDept: &amp;quot;Cardiac Surgeon&amp;quot;,
      doctorName: &amp;quot;Cardiac Surgeon 1&amp;quot;,
      doctorVisit: todate(today())
    ),
    a!map(
      doctorDept: &amp;quot;Cardiac Surgeon&amp;quot;,
      doctorName: &amp;quot;Cardiac Surgeon 2&amp;quot;,
      doctorVisit: todate(today() - 2)
    ),
    a!map(
      doctorDept: &amp;quot;Cardiac Surgeon&amp;quot;,
      doctorName: &amp;quot;Cardiac Surgeon 3&amp;quot;,
      doctorVisit: todate(today() - 3)
    ),
    a!map(
      doctorDept: &amp;quot;Cardiac Surgeon&amp;quot;,
      doctorName: &amp;quot;Cardiac Surgeon 4&amp;quot;,
      doctorVisit: todate(today() - 4)
    ),
    
  },
  local!doctorsList: a!refreshVariable(
    value: index(
      local!doctorsFullList,
      wherecontains(
        ri!requestedDept,
        local!doctorsFullList.doctorDept
      ),
      null
    ),
    refreshOnReferencedVarChange: true()
  ),
  {
    a!sectionLayout(
      label: &amp;quot;Appointment&amp;quot;,
      contents: {
        a!dropdownField(
          label: &amp;quot;Department&amp;quot;,
          labelPosition: &amp;quot;ABOVE&amp;quot;,
          placeholder: &amp;quot;--- Select a Value ---&amp;quot;,
          choiceLabels: local!dept,
          choiceValues: local!dept,
          value: ri!requestedDept,
          saveInto: { ri!requestedDept },
          searchDisplay: &amp;quot;AUTO&amp;quot;,
          validations: {}
        )
      }
    ),
    a!richTextDisplayField(labelPosition: &amp;quot;COLLAPSED&amp;quot;),
    a!sectionLayout(
      label: &amp;quot;List of Doctors&amp;quot;,
      contents: {
        if(
          length(local!doctorsList) = 0,
          a!richTextDisplayField(
            labelPosition: &amp;quot;COLLAPSED&amp;quot;,
            align: &amp;quot;LEFT&amp;quot;,
            value: a!richTextItem(
              size: &amp;quot;MEDIUM&amp;quot;,
              color: &amp;quot;ACCENT&amp;quot;,
              text: &amp;quot;No data selected&amp;quot;,
              style: &amp;quot;EMPHASIS&amp;quot;
            )
          ),
          a!columnsLayout(
            columns: {
              a!forEach(
                items: local!doctorsList,
                expression: {
                  a!columnLayout(
                    a!cardLayout(
                      contents: {
                        a!textField(
                          label: &amp;quot;Doctor Name:&amp;quot;,
                          labelPosition: &amp;quot;ADJACENT&amp;quot;,
                          value: fv!item.doctorName,
                          readOnly: true()
                        ),
                        a!textField(
                          label: &amp;quot;Doctor Dept:&amp;quot;,
                          labelPosition: &amp;quot;ADJACENT&amp;quot;,
                          value: fv!item.doctorDept,
                          readOnly: true()
                        ),
                        a!dateField(
                          label: &amp;quot;Doctor Visit:&amp;quot;,
                          labelPosition: &amp;quot;ADJACENT&amp;quot;,
                          value: fv!item.doctorVisit,
                          readOnly: true()
                        )
                      }
                    )
                  )
                }
              )
            }
          )
        )
      }
    ),
    a!richTextDisplayField(labelPosition: &amp;quot;COLLAPSED&amp;quot;),
    a!buttonLayout(
      primaryButtons: {
        a!buttonWidget(
          label: &amp;quot;Submit&amp;quot;,
          submit: true,
          style: &amp;quot;PRIMARY&amp;quot;,
          saveInto: {
            a!save(ri!docName, index(local!doctorsList,&amp;quot;doctorName&amp;quot;,null)),
            a!save(ri!docDept, index(local!doctorsList,&amp;quot;doctorDept&amp;quot;,null)),
            a!save(ri!docVisit, index(local!doctorsList,&amp;quot;doctorVisit&amp;quot;,null)),
            a!save(ri!selectedDoctors,local!doctorsList)
          }
        )
      },
      secondaryButtons: {
        a!buttonWidget(
          label: &amp;quot;Cancel&amp;quot;,
          value: true,
          saveInto: ri!cancel,
          submit: true,
          style: &amp;quot;NORMAL&amp;quot;,
          validate: false
        )
      }
    )
  }
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I hope that helps you.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Acacio B&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>