0

is it possible to make a Join over multiple Lists with a CAML query like in C# oder JSOM and show that view on a SharePoint page? I'm using Sharepoint Designer 2013 and Sharepoint 2013.

I have the following Code, but it does not work. I get the following error: "One or more field types are not installed properly. Go to the list settings page to delete these fields."

<View Name="{THISISTHEVIEWID}" MobileView="TRUE"  Type="HTML" Hidden="TRUE" DisplayName="" Url="url/to/my/list" Level="1" BaseViewID="1" ContentTypeID="0x" ImageUrl="/_layouts/15/images/generic.png?rev=23" >

<Joins>
    <Join Type="INNER" ListAlias="JOINLIST_">
        <Eq>
            <FieldRef Name="List To Join" RefType="ID" />
            <FieldRef List="JOINLIST_" Name="ID" />
        </Eq>
    </Join>
</Joins>

<ProjectedFields>
    <Field Name='Title_LookupList' Type='Lookup' List='JOINLIST_' ShowField='Title'/>
</ProjectedFields>

<ViewFields>
    <FieldRef Name="Field1"/>
    <FieldRef Name="Field2"/>
    <FieldRef Name="Title_Lookuplist" />
</ViewFields>

<Query>
    <OrderBy>
        <FieldRef Name="ID"/>
    </OrderBy>
<Where>
    <Eq>
        <FieldRef Name="Identifier" />
        <Value Type="Integer">1</Value>
    </Eq>
</Where>
</Query>


<RowLimit Paged="TRUE">30</RowLimit>
<Aggregations Value="Off"/>
<JSLink>clienttemplates.js</JSLink>
<XslLink Default="TRUE">main.xsl</XslLink>
<Toolbar Type="Standard"/>

</View>

EDIT: the "Identifier" field is a Yes/No field

The query works when I send it via JSOM to the server, but not in the HTML-View and inserted via SharePoint Designer. When I remove the Join, the ProjectedFields and <FieldRef Name="Title_Lookuplist" />, the View shows up as it should.

Is something like the 'join lists for a HTML-view' possible?

Thanks in advance!

0

I don't think it can be done with CAML. However, if you use Designer to insert an empty dataview, you can create a linked data source that you can join and filter.

  1. In Designer, go to Data Sources and create a new Linked Data Source
  2. Open your page in Advanced Edit Mode and insert empty data view.
  3. Click on "Click here to select a data source," select your linked data source, and set any filters you want.

If this option doesn't provide you with everything you need, you could look at using JQuery and SPServices to query the lists and join the results.

Your Answer

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

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