Within this post, we will explore how to configure the Lightning Conductor’s Object Model to aggregate SharePoint List and Library content from across your SharePoint environment.
Lightning Conductor SPFx Getting Started.
Introduction
The Object Model is a data source provider in the Lightning Conductor that works by performing an aggregation on the content in real-time. That is, if the aggregated content were to change within the list, such as a Task being changed from ‘In Progress’ to ‘Completed’, the Lightning Conductor would display the change immediately. We will look deeper into the Object Model’s configuration in this article.
Object Model Data Source Configuration
To aggregate lists with the Lightning Conductor, you can either use the Quick Configuration or the Advanced Mode to build a view of aggregated content. The Quick Configuration addresses some common scenarios, such as rolling up Tasks, Documents, Events etc. You can easily select the type of list that you want to aggregate, any filter requirements, choose your scope, and then display options. Once the results are displayed on the page, you can further customize your view using Data Formatting, Conditional Formatting, Adding and Removing Columns, Grouping and much more. The Advanced Mode allows you to be far more granular with other settings, including the Object Model, and we’ll focus on those options in this article.
The Object Model Configuration in the Data Source tab is divided into four main sections:
- Rollup Source
- List/Item Types
- Column Source
- Settings
Rollup Source
The Rollup Source describes where you would like your SharePoint list item to be aggregated from. At this point, we are only concerned with the source of the data, and not the type of data. The options are:
Show Items from Current Tenant: Aggregate content from the specified list or library type/s from all SharePoint sites within the Microsoft 365 Tenant.
Show Items from All Hub Sites and Associated Sites: Aggregate content from any specified list or library type from all hub sites and their associated sites within the environment.
Show Items from Current Site Collection: Aggregate content from the specified list or library type/s from the current site collection.
Show Items from Current Site and Associated Sites: Aggregate content from the specified list or library type/s from the current site (assuming it is a Hub Site) and any of its associated sites.
Show Items from Multiple Site Collections: Aggregate content from the specified list or library type/s from one or more site collections selected from the treeview.
Show Items from Current Site: Aggregate content from the specified list or library type/s from the current site only.
Show Items from Current Site and sub sites: Aggregate content from the specified list or library type/s from the current site and its subsites.
Show Items from Multiple Sites: Aggregate content from the specified list or library type/s from one or more sites selected from the treeview.
Show Items from Multiple Lists: Aggregate content from one or more lists selected from the treeview. For this option, List Type will not be required as it will be whatever list type/s the selected lists are.
Rollup Source selection
Clicking on the Site Collection/Site name selects that Site Collection/Site as the scope. Doing this will add a vertical line to the left of the Site name. If you want to select several Site Collections, click on each of their names rather than tick the boxes.
Ticking the box selects only subsites – or in the case of “Show Items from Multiple Site Collections”, only associated Sites of a Hub Site.
Once the scope has been selected, you can specify the type of content from that scope that you would like to include within the rollup - for example, Tasks or Announcements. The type of content can be further refined by specifying the content type group and content type used to create the list item. For example, your organization may have created a content type called Invoice that inherits from Document, which appears under ‘Custom Content Types’. If you selected Documents as the List Type and Invoice as the Content Type, only Invoices from Document Libraries would be included in the rollup. Any other list type that used the Invoice content type would not be included in the aggregation.
Columns Source
The Columns Source section is optional. Most of the time, you will not need to select a list as the column source. The Column Source has nothing to do with which list items are aggregated but helps to make custom columns available on the Columns tab of the web part. The Column Source is only relevant when some of your lists contain custom columns. By default, we will show all columns available for selection from the lists defined in the scope. However, if one of your lists contains a custom column which is not displayed as an available column within the Columns tab, you can select that list as the column source. All columns from that list will then be available to display within your view.
Settings
Item Limit: Use the Item Limit text box to restrict the number of items returned from the data source. Use this option for performance reasons. This limit will be applied to the first X amount retrieved from the data source.
Item Limit Per List: This will also restrict the number of items returned from the data source based on each source list separately. Also, use this for performance reasons.
Batch Size: This will specify the maximum count of items that could be retrieved from the list per each request.
Retrieve Missing Parent Folder / Retrieve Missing Parent Tasks: When grouping items by folders/task hierarchy, there could be situations when the rollup result contains an item whose parent item (i.e. parent folder or parent task) does not exist in the rollup result (e.g. depending on filters, item limit, etc). In that case, you might also wish to automatically retrieve missing parent items in order to render the full information of the parent item in the grid view. So when this option is not enabled, then in case of a missing parent item the Lightning Conductor will just render the information it has (for folders that's the folder name, and for tasks it's the task ID) without retrieving the parent item from SharePoint. When the option is enabled, then in case of a missing parent item, the Lightning Conductor will retrieve it from SharePoint and render the full parent information.
Allowed Filters
- Only Persistent: Allows all users to see the same filtered values that have been configured by the Lightning Conductor creator. Users cannot use the dynamic filtering capabilities of the Web Part.
- Only Dynamic: Only filters set by users will be used.
- Persistent and Dynamic (default): Use a combination of persistent filters and dynamic filters. The Web Part uses the persistent filter first to display a subset of items from the rollup source. The user can then use the Web Part’s filter options to further limit the displayed items.
- Ignore All: Display all items from the rollup source. That is, the persistent filter settings selected on the Display tab are ignored, and users cannot use dynamic filters.
Ignore Missing Columns Filter: Enable this option to ignore configured filters, for which the appropriate column does not exist in the list. For example, you might set a filter on Column X, but in some of the aggregated lists, Column X doesn't exist. By default, the Lightning Conductor won't display items from those lists, but you can enable this option to allow those items to be included.
Ignore Access Denied Errors: When the selected scope is several lists and the current user does not have access to some of the selected lists, then by default the entire rollup fails. When this option is enabled, the entire rollup will not fail in this case.
Enable Audience Targeting: Retrieve only items for which the current user belongs to the target audience for that item. When this option is enabled, another option will appear…
Include Not Targeted Items: Also retrieve all items which have no target audience set.
Convert Object Model Engine to Search Engine
We call this the “Magic Button”. You can choose to convert your existing Object Model rollup to a Search Engine rollup. To do so, select the conversion button on the Web Part tab of the view and follow the configuration instructions. You may need to specify names of mapped managed properties for relevant columns.