Report data source header changes ๐
Overview
In the Report Builder, you can create an Item data source to represent the attributes and properties of a particular item, and an AQS data source to fetch the attribute data of multiple items.
You may have tried to use an Item data source as a parameter within an AQS data source, e.g. to fetch the defect items raised against that item. Currently, this doesn’t work because the Item Id header of the Item data source is a Text type, which isn't directly comparable with actual Item IDs.
Therefore, we're changing the Item Id header type from Text (string
) to Link (AlloyId[]
) to make this possible!
To accommodate this, a few other changes will also happen.
Who will be affected?
This will affect report builders wishing to use an Item data source as a parameter within an AQS data source.
Details
The Item data sources in everyone's custom reports will be updated with this change automatically.
However, any existing AQS data sources containing an unusable parameter as described above will still throw an error (1586360664 - Parameter type String cannot be used in node of type AlloyId). To fix this, simply recreate the parameter.
No more sorting by Item Id
After this change, it will no longer be possible to sort by the Item Id header on any data source. Doing so will throw an error (1603203353 - Ordering is not supported on the following type AlloyId).
Hardly anyone has attempted this, so we don't envisage it causing issues going forward.
More flexible joins
To create a Join data source, you must select a header from each of the two data sources you wish to join. Currently, you can only join headers of the same type (or a Link type to a Text type).
After this change, it will be possible to join a Text header to any other header type and vice versa. The other header type will be "stringified" for comparison.
AQS statistics constraints
AQS statistics data sources contain two headers to represent the data returned by its query. The Key header is a Text type and the Value header is a Number type.
After this change, API users will be able to specify the type of these headers via two new optional properties:
KeyConstraint
- corresponds to the attribute being grouped on, so can be set to any attribute type.ValueConstraint
- corresponds to the aggregated values of the attribute being queried, so can be set to Number, DateTime or GeoJSON.
These can be declared within the relevant request model when using the /api/custom-report/{customReportCode}/data-source
endpoint to add (Swagger/ReDoc) or edit (Swagger/ReDoc) an AQS statistics data source.
This will be useful for creating joins in some scenarios.
For example, imagine having an AQS statistics data source that counts Waste Containers grouped by type, and an AQS data source that fetches items of the Waste Container Types design.
To create a Join data source from these, you would select the Key header (String) of the first data source and the Item Id header (Link) of the second data source.
By default, the Item Id header will be stringified for comparison with the Key header, so the join should work. However, you can set KeyConstraint
to "Link" to ensure an accurate comparison.
Expected release
29th June 2023 as part of the Alloy v2.48 release.