JungleDocs | FindItems function
You can use the FindItems function to filter lists using a specific value. In this tutorial, you will learn how to do this.
FindItems() function can be used in both Word and Excel documents to filter lists using a specific value. It returns multiple items. The syntax is as follows:
FindItems(ListName; ColumnName; Value)
- ListName - Name of the list you want to filter
- ColumnName - Name of the column that contains the value you will use to filter. The internal column name is advised.
- Value - the actual value you will be searching for
For example, if you have a contact list and it contains company data, you can use FindItems to return all contacts of a specific company. Let's say our list is called Contacts, the column that contains company data is called Company and the company we are going to search for is Contoso.
Our ready function will look like this:
You can use this function either in a Word document template, by entering it in content control's Tag field:
Or in an Excel document template as a comment:
Note: You need a repeating section to use FindItems function. For more information on how to configure Word and Excel templates and repeating sections, refer to Word template configuration or Excel template configuration.
From JungleDocs 3.6 you can use additional parameters in that function. Supported additional unlimited parameters and Date parameters.
Example with two conditions:
FindItems("TestList"; "ChoiceColumnName"; "ChoiseColumnValue"; "BooleanColumnName"; "0").
Note: Additional parameters work only as equal condition and they are combined by and operators.
For Boolean (Yes/No) column value use "0" to find "No" values, and "1" to find "Yes".
Examples with date conditions:
FindItems("TestList"; "ExpirationDate"; Today())– dynamic date used.
FindItems("TestList"; "ExpirationDate"; "01/10/2016")– static date used.
Note: time is not included, only dates.