Sharepoint Search REST query filter with special characters

Swapna Nethi 21 Reputation points
2020-11-10T16:34:51.603+00:00

I have a requirement to get all records where Status = Expired and Contract Renewability ='Yes (Auto Renew)' i tried below query but it does not bring any results. Can someone suggest what am i missing?

https://xxxx.sharepoint.com/sites/scr/_api/search/query?QueryText=%27scStatusOWSCHCS=Expired+scContractRenewabilityOWSCHCS=Yes%20%28Auto%20Renew%29%27&selectproperties=%27Title,scContractRenewability,SPWebUrl,OriginalPath,ListItemID,ModifiedBy%27&rowlimit=500

Microsoft 365 and Office | SharePoint | For business | Windows
{count} votes

Accepted answer
  1. Amos Wu-MSFT 4,051 Reputation points
    2020-11-11T06:33:40.517+00:00

    You can try to wrap the part containing special characters with double-quotes.

    https://xxxx.sharepoint.com/sites/scr/_api/search/query?QueryText='scStatusOWSCHCS=Expired scContractRenewabilityOWSCHCS="Yes (Auto Renew)"'&selectproperties='Title,scContractRenewability,SPWebUrl,OriginalPath,ListItemID,ModifiedBy'&rowlimit=500  
    

    I create a Contract Renewability column in my list.
    My test result:
    38910-image.png
    38956-image.png


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Swapna Nethi 21 Reputation points
    2020-11-16T16:38:16.327+00:00

    Thank you so much ! enclosing in double quotes worked !!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.