JungleDocs 365 | Get SharePoint list items. GetView function.
You can use JungleDocs to generate reports from multiple views or lists at once. However you will need to configure the JungleDocs template accordingly. The key to configuring such a template is the "repeated section". This is a table with nested content controls that allows multiple items to be inserted into it.
Note: The "Repeated section" Content Control should include only one table. This table should be 1x2 in size (1 column, 2 rows) or larger.
In order to retrieve data from your SharePoint lists, you have to associate the template with those lists/views. This can be done using the GetView() function.
The GetView() function is used to resolve items using the SharePoint View configuration and allows you to use the View's sorting, grouping and filtering (static filter). It returns items in a particular View. The syntax is as follows:
GetView("ListURL"; "ViewName") or GetView("ListURL"; "ViewName", "ColumnName", "ColumnValue")
- ListURL - Full URL for the list you want to take data from. For example: "https://yoursite.sharepoint.com/Lists/Companies"
- ViewName - Name of the List View, for example "All Items"
- ColumnName - Name of additional columns to filter
- ColumnValue - Value of another field without quotes or static value in quotes
GetView("TestList"; "All Items"; "TestChoice"; "Category1") - additional choice parameter.
GetView("TestList"; "TestView"; "TestChoice"; "Category1"; "TestBool"; "0") - two additional parameters (choice, boolean).
Note: Additional parameters works only as equal condition and they are combined by and operators.
For Boolean (Yes/No) column value use "0" to filter "No" values, and "1" to filter "Yes".
Examples with date conditions:
GetView("TestList"; "All Items"; "ExpirationDate"; Today() - dynamic date used.
GetView("TestList"; "All Items"; "ExpirationDate"; "01/10/2016") - static date used.
Let's see how to configure the template.
1. To use the function, create a table, select one row and add a content control to it by pressing the "Rich Text Content Control" button in the Developer tab's ribbon (Add developer tab in Word Options -> Customize):
2. Now click "Properties" and put the GetView("listurl"; "view name") function in the "Tag" and "Title" fields of the content control and press OK:
Note: Microsoft Office 2010 has a 64 character limit for the tag field, so it is better to use MS Office 2013 or 2016 to configure templates.
3. Now you need to add more content controls that will represent columns from this list. For example, if you need to create a report for a list of companies, and you want the table to contain Company names, addresses, emails and logos of the companies you'll need to add corresponding content controls inside of the GetView content control:
Note: for plain text columns - insert plain text content control and in the tag field enter the column name (we recommend to use internal names) of the Companies list;
If you want to insert a image from picture column - then insert a Picture Content Control.
4. Customize the table the way you want it to be, create more tables with their content controls linking to other lists, and you are ready to create reports from multiple lists.