Related Item Advanced Filter
Posted by Cloud.Ed - Feb 8 ’16 at 06:59
We would like to add to the filtering function on the related items control. We would like to add a second, third, etc... field to filter on. I see where the view portion has a "Query" section, can that be used to add to the filter. Like field 1 in the list matches field 1 in the form and field 2 in the list mathces "Active" or "Not Active".
I have used the filter builder in another Form Designer, InfoPath that allows this.
I hope that made sense.
Cloud.Ed
-
rostislavModeratorMember for: 7 years 16 days
You have a number of options:
1. If you want to perform filtering based on some constant values you can use the Query section, like you said. Please check the example here https://msdn.microsoft.com/en-us/library/office/ms479601.aspx for more information. You query would look something like this:
<Query> <Where> <And> <Eq> <FieldRef Name="Title"></FieldRef> <Value Type="Text">Bob</Value> </Eq> <Eq> <FieldRef Name="Surname"></FieldRef> <Value Type="Text">Robinson</Value> </Eq> </And> </Where> <OrderBy> <FieldRef Name="ID" /> </OrderBy> </Query>
2. If you want to perform non-dynamic filtering based on multiple columns you can use a calculated column:
i. Create a calculated field based on the fields that you require, for example: =CONCATENATE(Title,",",CustomField). Do this for both lists.
ii. Use the calculated fields for filtering.
3. Otherwise, you can perform dynamic filtering based on multiple columns by following this article http://formsdesigner.blogspot.com/2015/11/dynamic-filtering-of-related-items-list.html