[SalesForce] Get lightning:inputField value in javascript controller

I have following code in component which is called by another lightning component from aura:iteration. I want to get value from lightning inputField when it is changed in the javascript controller and store in v.item.Rep_Name1__c. BTW Rep_Name1__c is a lookup field.How can we achieve it?

<aura:attribute name="item" type="OPS__c" default="{ 'sobjectType': 'OPS__c' } "/>
<lightning:recordEditForm aura:id="recordViewForm" 
                            recordTypeId="0121N000001TLGbQAO"
                            objectApiName="OPS__c">
    <lightning:inputField fieldName="Rep_Name1__c" value="{!v.item.Rep_Name1__c}" aura:id="testpp" onchange="{!c.getOppProcess}"/>
</lightning:recordEditForm>

Javascript Controller (I am getting undefined when I try to retrieve value)

({
getOppProcess: function(component, event, helper) {
    debugger;
    var test = component.find("testpp").get("v.value");
},
)}

Thanks in advance.

Best Answer

The issue is that you are using id attribute here:

<lightning:inputField id="testpp" fieldName="Rep_Name1__c" value="{!v.item.Rep_Name1__c}" onchange="{!c.getOppProcess}"/>

Whereas, you need to use aura:id here to be able to get the value in your JS:

<lightning:inputField aura:id="testpp" fieldName="Rep_Name1__c" value="{!v.item.Rep_Name1__c}" onchange="{!c.getOppProcess}"/>