Related Item Advanced Filter

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
Cloud.Ed
Posts: 40
Joined: Fri Dec 04, 2015

08 Feb 2016

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

User avatar
rostislav
Moderator
Posts: 364
Joined: Mon Oct 19, 2015

09 Feb 2016

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/librar ... 79601.aspx for more information. You query would look something like this:

Code: Select all

<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://spform.com/forms-designer- ... point-form

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 17 guests