Report Templates
albert.resources.report_templates
ReportTemplateCategory
ReportTemplateSubCategory
The sub-category of a report template, describing its subject area.
Attributes:
| Name | Type | Description |
|---|---|---|
PROJECT |
str
|
A single project. |
INVENTORY |
str
|
Inventory items. |
TASKS |
str
|
Tasks. |
PRODUCTS |
str
|
Products. |
PROJECTS |
str
|
Projects. |
INVENTORY_LOTS_AND_HAZARDS |
str
|
Inventory lots and their hazards. |
PRODUCTS_FORMULAS |
str
|
Products and formulas. |
RESULT_AND_TASK_DATA |
str
|
Result and task data. |
BATCH_TASKS_AND_INVENTORY_USAGE |
str
|
Batch tasks and inventory usage. |
FilterType
FilterOption
Bases: BaseAlbertModel
A filter option for a report template.
Show JSON schema:
{
"$defs": {
"FilterType": {
"description": "The input type of a report template filter.\n\nAttributes\n----------\nDROPDOWN : str\n A dropdown selection populated from a data source.\nENUM : str\n A fixed set of enumerated values.\nBOOLEAN : str\n A true/false toggle.\nNUMBER : str\n A numeric value.",
"enum": [
"dropDown",
"enum",
"boolean",
"number"
],
"title": "FilterType",
"type": "string"
}
},
"description": "A filter option for a report template.",
"properties": {
"name": {
"description": "Name of the filter",
"title": "Name",
"type": "string"
},
"type": {
"anyOf": [
{
"$ref": "#/$defs/FilterType"
},
{
"type": "null"
}
],
"default": null,
"description": "Type of the filter"
},
"label": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Display label for the filter",
"title": "Label"
},
"url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "URL for filter data",
"title": "Url"
},
"payloadId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Payload ID for the filter",
"title": "Payloadid"
},
"method": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "HTTP method for filter data",
"title": "Method"
},
"values": {
"anyOf": [
{
"items": {},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Available values for the filter",
"title": "Values"
},
"default": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether this filter is default",
"title": "Default"
},
"singleSelect": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether single selection is allowed",
"title": "Singleselect"
},
"defaultValue": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Default values for the filter",
"title": "Defaultvalue"
}
},
"required": [
"name"
],
"title": "FilterOption",
"type": "object"
}
Fields:
-
name(str) -
type(FilterType | None) -
label(str | None) -
url(str | None) -
payload_id(str | None) -
method(str | None) -
values(list[Any] | None) -
default(bool | None) -
single_select(bool | None) -
default_value(list[str] | None)
FilterOptions
Bases: BaseAlbertModel
Filter options configuration for a report template.
Show JSON schema:
{
"$defs": {
"FilterOption": {
"description": "A filter option for a report template.",
"properties": {
"name": {
"description": "Name of the filter",
"title": "Name",
"type": "string"
},
"type": {
"anyOf": [
{
"$ref": "#/$defs/FilterType"
},
{
"type": "null"
}
],
"default": null,
"description": "Type of the filter"
},
"label": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Display label for the filter",
"title": "Label"
},
"url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "URL for filter data",
"title": "Url"
},
"payloadId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Payload ID for the filter",
"title": "Payloadid"
},
"method": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "HTTP method for filter data",
"title": "Method"
},
"values": {
"anyOf": [
{
"items": {},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Available values for the filter",
"title": "Values"
},
"default": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether this filter is default",
"title": "Default"
},
"singleSelect": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether single selection is allowed",
"title": "Singleselect"
},
"defaultValue": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Default values for the filter",
"title": "Defaultvalue"
}
},
"required": [
"name"
],
"title": "FilterOption",
"type": "object"
},
"FilterType": {
"description": "The input type of a report template filter.\n\nAttributes\n----------\nDROPDOWN : str\n A dropdown selection populated from a data source.\nENUM : str\n A fixed set of enumerated values.\nBOOLEAN : str\n A true/false toggle.\nNUMBER : str\n A numeric value.",
"enum": [
"dropDown",
"enum",
"boolean",
"number"
],
"title": "FilterType",
"type": "string"
}
},
"description": "Filter options configuration for a report template.",
"properties": {
"minFilters": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "Minimum number of filters required",
"title": "Minfilters"
},
"filters": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/FilterOption"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "List of available filters",
"title": "Filters"
}
},
"title": "FilterOptions",
"type": "object"
}
Fields:
-
min_filters(int | None) -
filters(list[FilterOption] | None)
FieldMapping
Bases: BaseAlbertModel
Field mapping configuration for a report template.
Show JSON schema:
{
"description": "Field mapping configuration for a report template.",
"properties": {
"url": {
"description": "URL for the field mapping",
"title": "Url",
"type": "string"
},
"fieldName": {
"description": "Name of the field",
"title": "Fieldname",
"type": "string"
},
"displayName": {
"description": "Display name for the field",
"title": "Displayname",
"type": "string"
}
},
"required": [
"url",
"fieldName",
"displayName"
],
"title": "FieldMapping",
"type": "object"
}
Fields:
-
url(str) -
field_name(str) -
display_name(str)
ReportTemplate
Bases: BaseResource
A reusable report configuration in Albert.
A report template defines a report type that can be run: its available
filters and its default column, chart, and metadata state. Templates are
retrieved through
ReportTemplateCollection and are
grouped by ReportTemplateCategory and ReportTemplateSubCategory.
Show JSON schema:
{
"$defs": {
"AuditFields": {
"description": "The audit fields for a resource",
"properties": {
"by": {
"default": null,
"title": "By",
"type": "string"
},
"byName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Byname"
},
"at": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "At"
}
},
"title": "AuditFields",
"type": "object"
},
"FieldMapping": {
"description": "Field mapping configuration for a report template.",
"properties": {
"url": {
"description": "URL for the field mapping",
"title": "Url",
"type": "string"
},
"fieldName": {
"description": "Name of the field",
"title": "Fieldname",
"type": "string"
},
"displayName": {
"description": "Display name for the field",
"title": "Displayname",
"type": "string"
}
},
"required": [
"url",
"fieldName",
"displayName"
],
"title": "FieldMapping",
"type": "object"
},
"FilterOption": {
"description": "A filter option for a report template.",
"properties": {
"name": {
"description": "Name of the filter",
"title": "Name",
"type": "string"
},
"type": {
"anyOf": [
{
"$ref": "#/$defs/FilterType"
},
{
"type": "null"
}
],
"default": null,
"description": "Type of the filter"
},
"label": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Display label for the filter",
"title": "Label"
},
"url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "URL for filter data",
"title": "Url"
},
"payloadId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Payload ID for the filter",
"title": "Payloadid"
},
"method": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "HTTP method for filter data",
"title": "Method"
},
"values": {
"anyOf": [
{
"items": {},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Available values for the filter",
"title": "Values"
},
"default": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether this filter is default",
"title": "Default"
},
"singleSelect": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether single selection is allowed",
"title": "Singleselect"
},
"defaultValue": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Default values for the filter",
"title": "Defaultvalue"
}
},
"required": [
"name"
],
"title": "FilterOption",
"type": "object"
},
"FilterOptions": {
"description": "Filter options configuration for a report template.",
"properties": {
"minFilters": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "Minimum number of filters required",
"title": "Minfilters"
},
"filters": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/FilterOption"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "List of available filters",
"title": "Filters"
}
},
"title": "FilterOptions",
"type": "object"
},
"FilterType": {
"description": "The input type of a report template filter.\n\nAttributes\n----------\nDROPDOWN : str\n A dropdown selection populated from a data source.\nENUM : str\n A fixed set of enumerated values.\nBOOLEAN : str\n A true/false toggle.\nNUMBER : str\n A numeric value.",
"enum": [
"dropDown",
"enum",
"boolean",
"number"
],
"title": "FilterType",
"type": "string"
},
"ReportTemplateCategory": {
"description": "The category of a report template.\n\nAttributes\n----------\nANALYTICS : str\n Analytics reports.\nDATASCIENCE : str\n Data science reports.\nREPORTS : str\n General reports.",
"enum": [
"analytics",
"datascience",
"reports"
],
"title": "ReportTemplateCategory",
"type": "string"
},
"ReportTemplateSubCategory": {
"description": "The sub-category of a report template, describing its subject area.\n\nAttributes\n----------\nPROJECT : str\n A single project.\nINVENTORY : str\n Inventory items.\nTASKS : str\n Tasks.\nPRODUCTS : str\n Products.\nPROJECTS : str\n Projects.\nINVENTORY_LOTS_AND_HAZARDS : str\n Inventory lots and their hazards.\nPRODUCTS_FORMULAS : str\n Products and formulas.\nRESULT_AND_TASK_DATA : str\n Result and task data.\nBATCH_TASKS_AND_INVENTORY_USAGE : str\n Batch tasks and inventory usage.",
"enum": [
"Project",
"Inventory",
"Tasks",
"Products",
"Projects",
"Inventory Lots and Hazards",
"Products / Formulas",
"Result and Task Data",
"Batch Tasks and Inventory Usage"
],
"title": "ReportTemplateSubCategory",
"type": "string"
},
"Status": {
"description": "The status of a resource.\n\nAttributes\n----------\nACTIVE : str\n The resource is fully operational and visible in normal operations.\nINACTIVE : str\n The resource is hidden from normal operations and disabled from use.",
"enum": [
"active",
"inactive"
],
"title": "Status",
"type": "string"
}
},
"description": "A reusable report configuration in Albert.\n\nA report template defines a report type that can be run: its available\nfilters and its default column, chart, and metadata state. Templates are\nretrieved through\n[`ReportTemplateCollection`][albert.collections.report_templates.ReportTemplateCollection] and are\ngrouped by [`ReportTemplateCategory`][albert.resources.report_templates.ReportTemplateCategory] and [`ReportTemplateSubCategory`][albert.resources.report_templates.ReportTemplateSubCategory].",
"properties": {
"status": {
"anyOf": [
{
"$ref": "#/$defs/Status"
},
{
"type": "null"
}
],
"default": null,
"description": "The status of the resource, optional."
},
"Created": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null,
"description": "Audit fields for the creation of the resource, optional."
},
"Updated": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null,
"description": "Audit fields for the update of the resource, optional."
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert ID of the report template. Set when the template is retrieved from Albert.",
"title": "Albertid"
},
"name": {
"description": "Name of the report template",
"maxLength": 255,
"minLength": 1,
"title": "Name",
"type": "string"
},
"description": {
"anyOf": [
{
"maxLength": 1000,
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Description of the report template",
"title": "Description"
},
"filterOptions": {
"anyOf": [
{
"$ref": "#/$defs/FilterOptions"
},
{
"type": "null"
}
],
"default": null,
"description": "Filter options configuration"
},
"filterState": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"description": "Current state of filters",
"title": "Filterstate"
},
"metaDataState": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"description": "Current state of metadata",
"title": "Metadatastate"
},
"chartModelState": {
"anyOf": [
{
"items": {},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Current state of chart models",
"title": "Chartmodelstate"
},
"columnState": {
"anyOf": [
{
"items": {},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Current state of columns",
"title": "Columnstate"
},
"spName": {
"description": "Stored procedure name",
"title": "Spname",
"type": "string"
},
"category": {
"$ref": "#/$defs/ReportTemplateCategory",
"description": "Category of the report template"
},
"subCategory": {
"anyOf": [
{
"$ref": "#/$defs/ReportTemplateSubCategory"
},
{
"type": "null"
}
],
"default": null,
"description": "Sub-category of the report template"
},
"customFields": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "List of custom field names",
"title": "Customfields"
},
"fieldMapping": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/FieldMapping"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Field mapping configuration",
"title": "Fieldmapping"
}
},
"required": [
"name",
"spName",
"category"
],
"title": "ReportTemplate",
"type": "object"
}
Fields:
-
status(Status | None) -
created(AuditFields | None) -
updated(AuditFields | None) -
id(str | None) -
name(str) -
description(str | None) -
filter_options(FilterOptions | None) -
filter_state(dict[str, Any] | None) -
meta_data_state(dict[str, Any] | None) -
chart_model_state(list[Any] | None) -
column_state(list[Any] | None) -
sp_name(str) -
category(ReportTemplateCategory) -
sub_category(ReportTemplateSubCategory | None) -
custom_fields(list[str] | None) -
field_mapping(list[FieldMapping] | None)
id
id: str | None = None
The Albert ID of the report template. Set when the template is retrieved from Albert.
sub_category
sub_category: ReportTemplateSubCategory | None = None
Sub-category of the report template