title: How do I get the value in a sessionScope variable within an appendItemValue call
body: <p>I created a sessionScope variable that hold a list of field names and another set that are made up of those field names and the values that are stored in them. </p>
  
  <p>allFieldNames is the scope variable that contains all the field name</p>
  
  <p>allFieldNames<br />
  [0] T0Q1<br />
  [1] T0Q2<br />
  [2] T1Q1<br />
  [3] T2Q1<br />
  [4] T3Q1<br />
  [5] T4aQ1<br />
  [6] T5Q1<br />
  [7] T6Q1<br />
  [8] T7Q1<br /></p>
  
  <p>SS Value<br />
  T0Q1 As a part of an acquiring/purchasing/merging with another company.<br />
  T0Q2 Yes<br />
  T1Q1 Strongly agree<br />
  T2Q1 Agree<br />
  T3Q1 I have an extensive active network of experts and resources.<br />
  T4aQ1 I sometimes require assistance<br />
  T5Q1 None of these.<br />
  T6Q1 To a reasonable extent<br />
  T7Q1 Agree<br />
  <br /></p>
  
  <pre><code>var questions = @List(sessionScope.allFieldNames);
  for( i=1; i &lt; sessionScope.ssTotalQuestions; i++ ) {
      viewScope.put("x", @Subset(@Subset(questions,i),-1));
      newDoc.appendItemValue(x, viewScope.x);
  }
  </code></pre>
  
  <p>The appendItemValue does create the field as I wanted but the problem I am having is that I cannot get the values in the matching scope variable. I know it is <B>viewScope.x</B> in my code that is causing the problem, but I cannot figure out how to identify and reference the scope variable at this point. </p>
  
  <p>FYI, there is no back end form to grab these field names from - this form is created on the fly, all fields are created on the form through this routine and it is then saved.</p>