Adding multiple fields to a Cross-Site Lookup field

rss

Posted by MES5464 - Sep 3 ’13 at 01:00

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

}

  • Dmitry
    Dmitry
    Admin
    Member for: 7 years 5 months 29 days
    #1 by Dmitry Sep 3 ’13 at 11:54

    Hello,

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

Displaying 1 to 1 of 1 messages