I just figured out how to filter against a sharepoint list choice type column. Myself being a beginner of sharepoint surfed web a lot to find how to filter for choice type column in a sharepoint list with no success. May be for experienced sharepoint developer this would be a piece of cake. But for me it took some 30 minutes of thinking. So I decided to post this for sharepoint beginners like me.
I have created a sharepoint list called "Customers" in my sample site called "contoso" and I tried to read the list as a feed using my browser. This list has four columns and Region and Size columns are Choice columns.
When I typed
http://spsrv/sites/Contoso/_vti_bin/ListData.svc/Customers
in my browser I got my customer list as a feed. Then I tried filtering for Name and it was easy and success.
http://spsrv/sites/Contoso/_vti_bin/ListData.svc/Customers?$filter=Name eq 'Fabrikam'
But when I tried to filter for Region column using
http://spsrv/sites/Contoso/_vti_bin/ListData.svc/Customers?$filter=Region eq 'East'
it did not give me the feed but gave "HTTP 400 The webpage cannot be found". I googled around but was not successful.
Then I thought a bit and and just opened the feed page viewsource. Aha! there I found the solution and what I was doing wrong. The choice columns had a suffix added as "Value". So my Region was RegionValue.
I then tried with following in my browser and successfully got the filter working against choice column.
http://spsrv/sites/Contoso/_vti_bin/ListData.svc/Customers?$filter=RegionValue eq 'East'
Subscribe to:
Post Comments (Atom)
Popular Posts
-
Dynamic block allows to create nested multi level block structures in terraform code. Conditional usage of such blocks are really useful in...
-
In Azure DevOps YAML pipelines there are several functions available for you to use. replace is such a useful function, which you can use t...
-
We have discueed, that we have to use an environment variable to handle input parameter default values, if we are using trigger for workflo...
-
Adding Azure Container Registry (ACR) service connection to Azure DevOps is really simple as described in " Create Service Connection ...
-
Some times a silly mistake can waste lot of time of a developer. The exception “System.IO.IOException: The response ended prematurely.” whil...
1 comment:
Thank you, was extremely helpful
Post a Comment