Page 1 of 1

Adding multiple fields to a Cross-Site Lookup field

Posted: 03 Sep 2013
by MES5464
I have been reading over the documentation of the cross-site lookup field and I cant figure out how to add more than one field in the dropdown item.

I have a Shows table and I want to display: ShowName, Show Start, Show End (where the start and end are dates), City, State.

I understand that the "item" parameter passed into the "Item format" function needs to be an object that carries in the additional fields. I believe that I need to modify the "Request items" function to bring in the additional fields but I do not understand how.

How do I include fields with spaces in the name?


Here is what I have:


function (term, page) {

if (!term || term.length == 0) {

return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField}, Show Start, Show End, Location&$orderby=Created desc&$top=10";

}

return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField}, Show Start, Show End, Location&$orderby={LookupField}&$filter=startswith({LookupField}, '" + term + "')&$top=10";

}


function(item) {

return '<span class="csl-option">' + item["{LookupField}"] + '</span><br />' +

'<span>' + item.Show Start + ' - ' + item.Show End + '</span><br />' +

'<span>' + item.Location + '</span>'

}

Re: Adding multiple fields to a Cross-Site Lookup field

Posted: 03 Sep 2013
by Dmitry Kozlov
Hello,

Please, use the internal names of your fields. They don't contain spaces.