Field with spaces
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";
}
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
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
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
-
- Information
-
Who is online
Users browsing this forum: No registered users and 18 guests