filter items by Site name and List Name using SPSiteDataQuery

I am listing files from multiple folders using the below code:

SPSiteDataQuery q = new SPSiteDataQuery(); q.Lists = "<Lists BaseType='1'/>"; q.Query = "<Where> <Where> <And><Neq><FieldRef Name='FSObjType'/><Value Type='Lookup'>1</Value></Neq> <Contains><FieldRef Name='ProjectProperty.Title' /><Value Type='Text'>Site_Name_Value_From_TextBox</Value></Contains> </And> </Where></Where>"; q.Webs = "<Webs Scope='Recursive' />"; q.ViewFields = "<FieldRef Name='ID' /><FieldRef Name='LinkFilename' /><FieldRef Name='File_x0020_Type' /><FieldRef Name='Title' /><FieldRef Name='FileRef' /><ListProperty Name='Title' /><ProjectProperty Name='Title' />";

the code is working fine for listing items, but i need to filter items by Site name and Library Name, i used

<Contains><FieldRef Name='ProjectProperty.Title' /><Value Type='Text'>Site_NAme</Value></Contains>

but i get no results, when i use Title or FileRef or any other field filter is working fine, what should i use instead of "ProjectProperty" and "ListProperty "??

-------------Problems Reply------------

Try

<FieldRef Name="SiteName" /><Value Type='Text'>Site_Name</Value>

or

<FieldRef Name="ows_SiteName" /><Value Type='Text'>Site_Name</Value>

Category:sharepoint Views:1 Time:2012-02-16

Related post

  • eBay API - filter items by store/custom categories 2010-12-16

    My scenario: I have a client with an eBay store with custom categories. On their website, they would like to list the items they have for sale. They would like this list to be filterable by custom category. I've been searching for a couple days now,

  • DRUPAL: order exposed filter items, be carefully it is not that simple (I cannot user "Sort") 2010-03-02

    DRUPAL question. I'm using Views, with an exposed filter (Taxonomy). I've downloaded the "better exposed filter" module to display it as checkbox list. a Now, how can I order the tags in the filter list ? "Views Sort" is not the solution because I on

  • Show number of results in each "filter item" 2010-04-15

    How can i get the number of each filter item in a seach? Example... im doing a job/resumes portal... i seach a job title and i have some filters items like City, State , area and etc... How can i show the number of each filter in the select box examp

  • Use LINQ, to Sort and Filter items in a List collection, based on the values within a List property which is part of the ReturnItem class 2010-05-06

    This is tricky to explain. We have a DataTable that contains a user configurable selection of columns, which are not known at compile time. Every column in the DataTable is of type String. We need to convert this DataTable into a strongly typed Colle

  • New-Item IIS:\Sites\SiteName - Index was outside the bounds of the array 2011-12-01

    I created a function to create a site in IIS, but I"m running into a bizzare error. Here's the url I've been using as a reference: http://learn.iis.net/page.aspx/433/powershell-snap-in-creating-web-sites-web-applications-virtual-directories-and-appli

  • Enumerate over DataTable, filter items, then revert to DataTable 2012-02-27

    I'd like to filter items in my DataTable by whether a column value is contained inside a string array by converting it to an IEnumerable<DataRow>, afterwards I'd like to re-convert it to DataTable since that's what my method has to return. Here

  • "gpedit.msc" service becomes not responding whenever I try to filter items in it from the Action Tab. 2013-08-21

    Original Title: gpedit.msc is not responding gpedit.msc service becomes not responding whenever I try to filter items in it from the Action Tab. Why is it happening and a possible solution? --------------Solutions------------- I restarted my PC and t

  • SmartScreen Filter keeps flaging sites that are safe 2014-05-31

    Smart Screen Filter is flaging sites in my email that are safe. --------------Solutions------------- Thank you very much for your prompt reply, but however, I found out that this was a Windows live mail problem and as of 3/15/12 they have resolved th

  • Pivot Table - can't filter items in page area 2014-10-02

    Hello, I need to be able to filter items in the page area of a Pivot Table but I don't see the option.. in other areas such as column or line I see the option as shown in the picture below. Can anyone help? Best regards. PS: I can't upgrade my Excel

  • How can I filter items from a list in Python? 2009-08-21

    I have data naively collected from package dependency lists. Depends: foo bar baz >= 5.2 I end up with d = set(['foo','bar','baz','>=','5.2']) I don't want the numerics and the operands. In Perl I would @new = grep {/^[a-z]+$/} @old but I can't

  • How to write a Google Analytics filter to record site searches 2009-09-01

    I what to record all my website searches with google analytics but the problem is my search links look like this **www.mywebsite.com/search/category/your+query+here** From what i found out i must give GA the query parameter (mywebsite.com/search.php?

  • F#: Filter items found in one list from another list 2009-10-01

    Say I have two lists: let a = [1 .. 1000] let b = [250 .. 500] How do I get a new list that contains the values {1-249, 501-1000}? --------------Solutions------------- Since your list is sorted, you can solve this in linear time using this (non-tail

  • Hide filter items that produce zero results in django-filter 2010-02-02

    I have an issue with the django-filter application: how to hide the items that will produce zero results. I think that there is a simple method to do this, but idk how. I'm using the LinkWidget on a ModelChoiceFilter, like this: provider = django_fil

  • How to filter items in a ListBox based on a searched string 2010-05-06

    I have a Windows Forms application (C#) containing a ListBox into which I have added some items (I'm not using a DataSource). I want to filter the items in the ListBox to show only items containing a string I'm searching for. I have done this by keep

  • Drupal Views how to filter items overlapping a date range 2010-06-08

    in Drupal I have used CCK to add a datetime field to my custom data type. It inserts start date and end date fields. That is what I want. Now, I want Views to filter and show only the items that have the daterange (start date and end date) overlappin

  • Custom Manager to filter objects on site but not in admin? 2010-08-16

    I followed this example and it works great but I'm wondering if I can put in an exception so that when I am in the admin all objects show up (active and inactive). This might be simple but I can't find how to do it in the docs. Here's what my manager

  • Magento: getting an attribute of a nav filter item 2010-10-11

    So I'm getting more and more familiar with the layered navigation Magento employs, and I do notice that it's possible to get various attributes of the items, like Name or a string Value, however there's one attribute I cannot get easily from the mode

  • In SQL Server, what is the best way to filter items for an entire day 2011-05-08

    In SQL Server, I want to show all items for a particular day. What is the best way to do this: DATEPART, BETWEEN, OR >= + < ? All 3 should work functionally, but are some of them better/worse for performance? 1) SELECT * FROM BlogPosts WHERE DA

  • How to filter item before loading them in isotope 2011-06-12

    I'm using isotope's filter function. I wrote: $('#stage').isotope({ filter:selector }); in two places: $(window).load(function() --> so that when users type url with hash(#), they can see the content items which is filtered out already. $('.filter

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.169 (s). 11 q(s)