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
lakshmi surendranlakshmi surendran 

Dynamic field name in lightning:input

I am getting fieldnames from object and iterating throught it. I need to create record with the values from the fieldname. Can someone help to provide the fieldname dynamically in lightning:input. 


<aura:component controller="ModelTabsController">
    <aura:attribute type="String" name="TabsList"/>
    <aura:attribute name="selTabId" type="String"/>
    
    <aura:attribute name ="RFAId" type="String"/>
    
    <aura:attribute name="newRFA" type="Object"/>
    <aura:attribute name="simpleNewRFA" type="Object"/>
    <aura:attribute name="newRFAError" type="String"/>
    
      <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    
    <force:recordData aura:id="ldsAccountEdit"
     recordId="{!v.AccId}"
     layoutType="FULL"
     mode="EDIT"
     targetRecord="{!v.newRFA}"
     targetFields="{!v.simpleNewRFA}"
     targetError="{!v.newRFAError}" />

<force:recordData aura:id="AccountRecordCreator"
     layoutType="FULL"
     mode="EDIT"
     targetRecord="{!v.newRFA}"
     targetFields="{!v.simpleNewRFA}"
     targetError="{!v.newRFAError}" />  
    
    
    
    <div class="slds-grid slds-wrap">
            <div class="slds-col slds-size_1-of-1">
     <lightning:tabset variant="vertical" selectedTabId="{!v.selTabId}" >
    <aura:iteration items="{!v.TabsList}" var="t">
        
              <lightning:tab id="{!t.Tab.Name}" label="{!t.Tab.Name}">
              
                    <aura:iteration items="{!t.HeaderList}" var="Header">
                        
                        <div class="slds-col slds-size_1-of-1">
                            <h2 class="header slds-m-left_x-small">{!Header.HeaderSequence__c}.{!Header.Name}</h2></div>
                        <div class="slds-grid slds-wrap">
                        <aura:iteration items="{!Header.ModelTabQuestions__r}" var="Q">
                                       
                                      <div class="{!Q.column__c}">
                                        <lightning:input type="{!Q.FieldType__c}" class="slds-m-around_x-small" name="input1"  label="{!Q.Questions__c}" value="{!v.simpleNewRFA+'.'+v.FieldName__c}"/>
                                        </div>
                             
                            </aura:iteration></div>
                  </aura:iteration>
             </lightning:tab>
       
        
        </aura:iteration>
          </lightning:tabset>
        </div>
    </div>
   
</aura:component>