title: How do I add value to my ligthning input using aura:iteration during onChange event of text box
body: <p>Hi I'm new to salesforce. I'm trying to develop a lightning component that will take user input, process that input &amp; will display the value in two text box.My lightning component looks like</p>
  
  <pre><code>&lt;aura:component implements="flexipage:availableForAllPageTypes,force:appHostable" access="global" controller="VisionController"&gt;
  &lt;!--Remember to define your binding attribute--&gt;
  &lt;aura:attribute name="val" type="String"/&gt;
  &lt;lightning:card title="Partner Information"&gt;
      &lt;div class="slds-p-around_medium"&gt;
          &lt;p&gt;
              &lt;!--Set you attribute as the value of the lightning:input component--&gt;
              &lt;lightning:input aura:name="val" 
                               label ="Enter KPI" 
                               value="{!v.val}" 
                               type="text" 
                               onchange="{!c.onChange}"/&gt;
          &lt;/p&gt;
      &lt;/div&gt;
  &lt;/lightning:card&gt;
  </code></pre>
  
  <p></p>
  
  <p>My JS controller looks like </p>
  
  <pre><code>({
  onChange : function(component, event, helper) {
  
  var action = component.get("c.getCallKPI")
      action.setParams({
          "value":val,
  
      })
      $A.enqueueAction(action)
  
  }
  </code></pre>
  
  <p>})</p>
  
  <p>I tried to do the iteration portion in controller using following code</p>
  
  <pre><code> var prediction=component.find("pred")
      var predictionProb=component.find("predProb")
   &lt;aura:iteration items="{c.getCallKPI}" var="predUrl" &gt;
          prediction.value="{!predUrl.label}"
          predictionProb.value="{!prediction.probability}"
      &lt;/aura:iteration&gt;    
  </code></pre>
  
  <p>where prediction &amp; predictionProb are  id of two lightning inputs given in my component.But I'm getting syntax error at <code>&lt;/aura:iteration&gt;</code></p>
  
  <p>If I'm doing it in component using following code</p>
  
  <pre><code> &lt;aura:iteration items="{c.getCallKPI}" var="predUrl" &gt;
  
              &lt;lightning:input id="pred" readonly="true"  value="{!predUrl.label}"/&gt;
              &lt;lightning:input id="predProb" readonly="true" value="{!predUrl.probability}" /&gt;
  
      &lt;/aura:iteration&gt;
  </code></pre>
  
  <p>Then it's not giving any error but not populating the inputs.
  Can you guide how do I resolve this? </p>
  
  <p>my getCallKPI is given below</p>
  
  <pre><code>@auraEnabled
  public static List&lt;KPI.Prediction&gt; getCallKPI(string value) {
  
      return KPI.Prediction;
  
  }
  </code></pre>