Field with spaces

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
Wvgent
Posts: 1
Joined: Mon May 02, 2016

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";
}

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

03 May 2016

Hi,

Please, note that you have to use internal names of fields in the requests. You can find how to obtain internal names in the following thread:

https://social.msdn.microsoft.com/Forum ... mentlegacy

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 12 guests