diff --git a/src/services/SPService.ts b/src/services/SPService.ts index 1887d539b..c6f72f2b3 100644 --- a/src/services/SPService.ts +++ b/src/services/SPService.ts @@ -240,7 +240,12 @@ export default class SPService implements ISPService { orderByStr = ``; } - const camlQuery = `${substringSearch ? '' : ''}${filterText}${substringSearch ? '' : ''}${orderByStr}`; + let filterPart = "" + if (filterText) { + filterPart = `${substringSearch ? '' : ''}${filterText}${substringSearch ? '' : ''}` + } + + const camlQuery = `${filterPart}${orderByStr}`; apiUrl = `${webAbsoluteUrl}/_api/web/lists('${listId}')/GetItems(query=@v1)?$select=${keyInternalColumnName || 'Id'},${internalColumnName}&@v1=${JSON.stringify({ ViewXml: camlQuery })}`; isPost = true;