function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rohith Kumar 98Rohith Kumar 98 

How to have different instance for each row in table row populated with aura:iteration?

I have a button named "Add Line Item" clicking on will create a new row in the table. 

When I add one row and change the value in the second column (PRODUCT NAME).
User-added image
After selecting the value and adding one more row, the values of the first row are copied to the second row also, when I change the value(lightning:select) in any row, It changes in all other rows.
User-added image

What is causing this and how can I solve the problem, I need different instances for each row.

Body of table component:
<tbody>
          <aura:iteration items="{!v.rowCount}" indexVar="count" >
            <tr>
              <td>{!count + 1}</td>
              <td><lightning:select variant="label-hidden" class="label-hidden" value="{!v.selectedItem}" onchange="{!c.getValue}">
                <option>--None--</option>
                <aura:iteration items="{!v.relatedItems}" var="item">
                  <option selected="{!item.selected}" value="{!item.UnitPrice__c}">{!item.Name}</option>
                </aura:iteration>
              </lightning:select></td>
              <td><lightning:input disabled="true" value="{!v.itemUnitPrice}" variant="label-hidden"/></td>
              <td><lightning:input type="number" variant="label-hidden" autocomplete="off"/><!--Quantity here--></td>
              <td>Price here</td>
              <td>Delete Icon Here</td>
            </tr>
          </aura:iteration>
</tbody>