Adding multiple fields to a Cross-Site Lookup field

Discussions about Cross-site Lookup
Locked
MES5464
Posts: 94
Joined: Mon Aug 26, 2013

03 Sep 2013

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>'

}

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

03 Sep 2013

Hello,

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

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests