Query templates can now be configured to allow multiple target collections. With this feature, you no longer have to create a separate query template for each collection. You can already create the query template just once and then run it against the allowed collections, one at a time. This improves the maintenance efficiency and is especially useful for multiple collections with the same data structure.
This feature can be activated through a toggle available in the Template Designer. Once the toggle is activated, the icon offers a dialog from which you can select the collection category and the allowed collections themselves. Minimum two collections are required, namely the default one and at least one more.
Once the query template is created or updated to allow multiple collections, you can choose which one of the allowed collections to query in the Template Runner. In particular, there is an additional parameter field called Target collection, which offers a drop-down with the allowed collections.
The multiple allowed collections are also reflected in the widget data sources pane. If such a query template is selected as a data source of a widget, an additional field shows the Target collection parameter, with the allowed collections listed in a drop-down menu. You can select a collection from this list or select a dynamic reference from the Allowed references field on the right.
Find out more in:
- Creating a query template
- Executing a query template
- Widgets, e.g. Input widget