Field with spaces
Posted: 03 May 2016
Hi all,
I'm having trouble adding a field with a space in it.
I'm trying to filter results in the lookup field by column Maatwerk 2 and contains the value 'Maat 1'.
The results from Maatwerk 2 all start with the items containing the value 'Maat 1'
But I keep getting the error "Failed loading".
This is my code below:
function (term, page) {
if (!term || term.length == 0) {
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField}&$filter=startswith(Maatregel 2, 'Maat 1')&$orderby=Created desc&$top=10";
}
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField}&$orderby={LookupField}&$filter=startswith({LookupField}, '" + encodeURIComponent(term) + "')and startswith(Maatregel 2, 'Maat 1')&$top=10";
}
I'm having trouble adding a field with a space in it.
I'm trying to filter results in the lookup field by column Maatwerk 2 and contains the value 'Maat 1'.
The results from Maatwerk 2 all start with the items containing the value 'Maat 1'
But I keep getting the error "Failed loading".
This is my code below:
function (term, page) {
if (!term || term.length == 0) {
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField}&$filter=startswith(Maatregel 2, 'Maat 1')&$orderby=Created desc&$top=10";
}
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField}&$orderby={LookupField}&$filter=startswith({LookupField}, '" + encodeURIComponent(term) + "')and startswith(Maatregel 2, 'Maat 1')&$top=10";
}