0

I can't find a way to update a multiselect with a slash in it. In my research because of the error message "Error in query syntax" the problem is somehow how I encode the field name which seems to be right as I cannot fetch the info for the option at all.

Fetching all types for the multi select

>>> get('https://<domain>/sites/<site>/_vti_bin/listdata.svc/MyListMyType')
[..]
{'Value': 'A',
 '__metadata': {
   'type': 'Microsoft.SharePoint.DataService.MyListMyType',
   'uri': "https://<domain>/sites/<site>/_vti_bin/listdata.svc/MyListMyType('A')"}},
{'Value': 'B/C',
 '__metadata': {
   'type': 'Microsoft.SharePoint.DataService.MyListMyType',
   'uri': "https://<domain>/sites/<site>/_vti_bin/listdata.svc/MyListMyType('B/C')"}},

Fetching the A option works fine

>>> get("https://<domain>/sites/<site>/_vti_bin/listdata.svc/MyListMyType('A')")
{'Value': 'A',
 '__metadata': {
   'type': 'Microsoft.SharePoint.DataService.MyListMyType',
   'uri': "https://<domain>/sites/<site>/_vti_bin/listdata.svc/MyListMyType('A')"}}

But fetching the B/C option fail with the same error like I got when tried to update an item.

>>> get("https://<domain>/sites/<site>/_vti_bin/listdata.svc/MyListMyType('B/C')")
{"error": {
  "code": "", 
  "message": "lang": "en-IN", "value": "Bad Request - Error in query syntax."}}}

And as we can see that is using the URL received in the first request. I have also tried a few different encodings like %2F but none seems to work for me.

How am I supposed to encode such a field?

Edit: The usage for it would be in a item update request, not only in a search.

  • I seem to have a similar problem with parentheses, for example if the option name is something like "B (C)". – davl Sep 24 at 14:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.