sharepointsharepoint-designersharepoint-workflowsharepoint-webservice

SharePoint HTTP Web service


I'm designing a workflow in SharePoint designer that uses a HTTP web service step via GET method. I have used it successfully before but this time I think the issue is with the name of the list but I'm not sure how to fix it.

Now the original name of the list "Engineers' Items-Table". As you can see, there's an apostrophe in the name. So initially I tried the following url which returned 0 records:

https://<domain>/_api/web/lists/getbytitle('Engineers' Items-Table')/items/?$select=Id

Then I renamed the list to "Engineer Items-Table" and tried the url:

https://<domain>/_api/web/lists/getbytitle('Engineer Items-Table')/items/?$select=Id

which doesn't return any results either. I tried using escape character %27 instead of the apostrophe which is not working either. SharePoint doesn't throw any exception. Workflow completes without an issue but without returning any items from the list.

Really appreciate your input. Thanks.


Solution

  • Instead of using "%27" use " ' " as escape character.

    https://<domain>/_api/web/lists/getbytitle('Engineers'' Items-Table')/items/?$select=Id
    
    1. Renaming the list might not change the behaviour because what you'll be changing now will be only the display name.
    2. Next keep the query simple remove select as a start once you start getting result add select and filters.
    3. Use POSTMAN which is a Chrome extension helps you find the error quickly.