Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I was wondering if you could help me with something.

I have a list called Site Configuration. One of the columns is called Package Level (Package_x0020_Level) and is a lookup that looks at the Packages list and pulls back an order number (Order0).

There is only ever one item in the Site Configuration list. I want to access this item, get the number in Package Level, and use it as a parameter in dataviews throughout the site.

The site is rolled out to different clients, so I want to show/hide different list items throughout the site based on the package level.

I'm not sure of the best way to do this. I tried REST:

http://<domain>/_vti_bin/ListData.svc/SiteConfiguration(1)/?$select=Package_x0020_Level  

or

http://<domain>/_vti_bin/ListData.svc/SiteConfiguration(1)/?$expand=Package_x0020_Level&$select=Package_x0020_Level/Order0

or lots of other variations. But that's giving me 'HTTP 400 Bad Request'...

And I tried a CAML query with lists.asmx - I can get the value back with this but it returns data from the Site Config list, and the lookup list, so not sure how to take the first digit and use it as a parameter for my dataviews.

I've hope I've made all this clear. Thanks in advance for any help.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Please try using "PackageLevel" in the REST Query instead of "Package Level" which is the display name of the field. What I have observed is that neither display name of the field nor its internal name work. It is actually the display name minus spaces which works. I have written a blog post about it here: http://sharepointnadeem.blogspot.in/2012/01/sharepoint-2010-rest-api.html and here: http://sharepointnadeem.blogspot.in/2012/06/field-names-in-rest-query-are-case.html

share|improve this answer
    
Thanks Nadeem. Your advice got me there. I had suspected that the name was wrong and tried lots of combinations, but got unusable errors from IE. I decided to use XML Notepad 2007 to view the XML and XML output and was able to identify the field as PackageLevelId. It's still not displaying in IE8, but hopefully it will work in SPD2010 when I attempt to use it as a paramter. If I remember, I'll let you know... –  Cliff Shamone Nov 7 '12 at 15:25
    
It worked! I created a REST Service Connection data source control in SPD2010 using http://<domain>/_vti_bin/ListData.svc/SiteConfiguration(1)/?$select=PackageLevel‌​Id I then created a parameter on the list view pointing to the data source control and use the package level number coming from the Site Config list to filter the reports shown in the doc library. Nice. –  Cliff Shamone Nov 7 '12 at 16:33
    
Glad, I could help. –  Nadeem Yousuf Nov 8 '12 at 4:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.