Page 1 of 1

Related Item - Filter twice with Data Source and CAML-View possible?

Posted: 10 Feb 2020
by slashmaster
Hi,

i want to filter and show related Items. The first filter works fine: Data Source - Filter by Form field.
I got a Choice-Column "Status" (possible entries 'open', 'in work', 'question') and i want to Show only this items where are 'Status=open'.

In the "Extended"-Option, i edit the "View" without success:

[…]
<Query />
<Where>
<Eq>
<FieldRef Name="Status" />
<Value Type="Choice">open</Value>
</Eq>
</Where>
[…]

It is possible to filter in CAML-View?

thanks in advanced

Re: Related Item - Filter twice with Data Source and CAML-View possible?

Posted: 10 Feb 2020
by mnikitina
Hello slashmaster,

Yes, you can filter the list view with the CAML query. Please see the code sample below.

Code: Select all

[...]
  <Query>
    <Where>
      <Eq> 
	<FieldRef Name="Status" /><Value Type="Choice">open</Value></Eq>
    </Where>
  </Query>
[...]
Or you can apply a filter in the list view settings. Go to List Settings >> Views.
ListView.PNG
ListView.PNG (62.95 KiB) Viewed 4641 times

Re: Related Item - Filter twice with Data Source and CAML-View possible?

Posted: 11 Feb 2020
by slashmaster
Good Morning mnikitina,

thank u very much, it works as expected!

Kind regards

Re: Related Item - Filter twice with Data Source and CAML-View possible?

Posted: 22 Apr 2020
by slashmaster
Hi mnikitina,

it is possible to filter dynamic based on Form-Field-Value? I want to get all related Items where are in the same Department (for that i use DateSource - Filter by Form-Field) and Status eq to Status from Form-Field i load (not fixed "open" like in your Code/answer below).

thanks in advanced :)

Re: Related Item - Filter twice with Data Source and CAML-View possible?

Posted: 23 Apr 2020
by mnikitina
Hello slashmaster,

Yes, it is possible. Please find the setup instructions in the Dynamic filtering of the Related Items list on a SharePoint form article.