I would like to get the lookup Value from a List item depending on it's Title.
My List is set up similar to the following example:
ColumnA : a | b | c
lookupB : 1 | 1 | 2
The jquery:
function getValues(ListName)
{
$.getJSON('http://<pageName>/_vti_bin/ListData.svc/' + ListName + '?',
function(data) {
$.each(data.d.results,
function(index, value) {
$('#select').append
($('<option>/option>').val(index).html(value.Titel
+ value.lookupB));
});
});
}
The #select value is a <select>
DropDown Menu and the options are filled correctly with the first value, but the lookup value only consists of [Object object] or undefined after trying different keys.
EDIT: I actually found out by looking into the Array of
value.lookupB
that I can add avalue.lookupB.__deferred
. The latter returns an uri pointing to:
http://<page>/_vti_bin/ListData.svc/ColumnA(1)/lookupB
Is there a way to access the information without parsing the JSON again?
Thank you.