In list A I have column test I'd and Testdepartment. Testdepartment is a look column to ListA Testdepartment is present in ListB
Values in the column are as below:
Test ID Test department
1 A
1 B
1 C
1 D
2 E
endPointUrl ="/_api/Web/Lists/GetByTitle ('List A')/Items?$select=Test I'd, Testdepart ment/Title&$expand=Testdepartment/I'd";
I am using the below code to extract the Test department value based on the test I'd
getdatafrom(endPointUrl).done(function(){
Var len = data.d.results.length;
for(i=0;i<len;i++){
Var x=data.d.results[i].Testdepartment.Title;
}
});
But the above code returns only the last element of the array i.e., D on selection of TestID as 1 .
I want the code to return all the Testdepartment associated with the Specific TestID so that I can put it as a filter for another endpointurl.
endPointUrl2="/_api/Web/Lists/GetByTitle ('List B')/Items?$select=Title, Testdepart &$filter=Title eq"+x;