---
title: "Get calculated fields (getCalculatedFields)"
method: GET
path: "/api/calculatedFields"
tags: ["calculated-field-controller"]
---

# Get calculated fields (getCalculatedFields)

`GET /api/calculatedFields`

Fetch tenant calculated fields based on the filter.

## Query parameters

- `pageSize` integer, required
- `page` integer, required
- `types` string[]
- `entityType` 'TENANT' | 'CUSTOMER' | 'USER' | 'DASHBOARD' | 'ASSET' | 'DEVICE' | 'ALARM' | 'RULE_CHAIN' | 'RULE_NODE' | 'ENTITY_VIEW' | 'WIDGETS_BUNDLE' | 'WIDGET_TYPE' | 'TENANT_PROFILE' | 'DEVICE_PROFILE' | 'ASSET_PROFILE' | 'API_USAGE_STATE' | 'TB_RESOURCE' | 'OTA_PACKAGE' | 'EDGE' | 'RPC' | 'QUEUE' | 'NOTIFICATION_TARGET' | 'NOTIFICATION_TEMPLATE' | 'NOTIFICATION_REQUEST' | 'NOTIFICATION' | 'NOTIFICATION_RULE' | 'QUEUE_STATS' | 'OAUTH2_CLIENT' | 'DOMAIN' | 'MOBILE_APP' | 'MOBILE_APP_BUNDLE' | 'CALCULATED_FIELD' | 'JOB' | 'ADMIN_SETTINGS' | 'AI_MODEL' | 'API_KEY'
- `entities` string[]
- `name` string
- `textSearch` string
- `sortProperty` 'createdTime' | 'name'
- `sortOrder` 'ASC' | 'DESC'
- `params` MultiValueMapStringString, required
  - `all` object

## Response `200`

OK

- PageDataCalculatedFieldInfo
  - `data` CalculatedFieldInfo[] — Array of the entities
    - `id` CalculatedFieldId
      - `id` string, uuid, required — ID of the entity, time-based UUID v1
      - `entityType` 'CALCULATED_FIELD', required — string
    - `createdTime` integer — Timestamp of the calculated field creation, in milliseconds
    - `tenantId` TenantId
      - `id` string, uuid, required — ID of the entity, time-based UUID v1
      - `entityType` 'TENANT', required — string
    - `entityId` EntityId
      - `id` string, uuid, required — ID of the entity, time-based UUID v1
      - `entityType` 'TENANT' | 'CUSTOMER' | 'USER' | 'DASHBOARD' | 'ASSET' | 'DEVICE' | 'ALARM' | 'RULE_CHAIN' | 'RULE_NODE' | 'ENTITY_VIEW' | 'WIDGETS_BUNDLE' | 'WIDGET_TYPE' | 'TENANT_PROFILE' | 'DEVICE_PROFILE' | 'ASSET_PROFILE' | 'API_USAGE_STATE' | 'TB_RESOURCE' | 'OTA_PACKAGE' | 'EDGE' | 'RPC' | 'QUEUE' | 'NOTIFICATION_TARGET' | 'NOTIFICATION_TEMPLATE' | 'NOTIFICATION_REQUEST' | 'NOTIFICATION' | 'NOTIFICATION_RULE' | 'QUEUE_STATS' | 'OAUTH2_CLIENT' | 'DOMAIN' | 'MOBILE_APP' | 'MOBILE_APP_BUNDLE' | 'CALCULATED_FIELD' | 'JOB' | 'ADMIN_SETTINGS' | 'AI_MODEL' | 'API_KEY', required
    - `type` 'SIMPLE' | 'SCRIPT' | 'GEOFENCING' | 'ALARM' | 'PROPAGATION' | 'RELATED_ENTITIES_AGGREGATION' | 'ENTITY_AGGREGATION'
    - `name` string — User defined name of the calculated field.
    - `debugMode` boolean
    - `debugSettings` DebugSettings
      - `failuresEnabled` boolean — Debug failures.
      - `allEnabled` boolean — Debug All. Used as a trigger for updating debugAllUntil.
      - `allEnabledUntil` integer — Timestamp of the end time for the processing debug events.
    - `configurationVersion` integer — Version of calculated field configuration.
    - `configuration` SimpleCalculatedFieldConfiguration, required
      - `arguments` object, required
      - `expression` string
      - `output` union, required
        - AttributesOutput
          - `name` string
          - `scope` 'CLIENT_SCOPE' | 'SERVER_SCOPE' | 'SHARED_SCOPE'
          - `decimalsByDefault` integer
          - `strategy` union
            - AttributesImmediateOutputStrategy
              - …
            - AttributesRuleChainOutputStrategy
              - …
          - `type` string, required
        - TimeSeriesOutput
          - `name` string
          - `scope` 'CLIENT_SCOPE' | 'SERVER_SCOPE' | 'SHARED_SCOPE'
          - `decimalsByDefault` integer
          - `strategy` union
            - TimeSeriesImmediateOutputStrategy
              - …
            - TimeSeriesRuleChainOutputStrategy
              - …
          - `type` string, required
      - `useLatestTs` boolean
    - `version` integer
    - `entityName` string
  - `totalPages` integer — Total number of available pages. Calculated based on the 'pageSize' request parameter and total number of entities that match search criteria
  - `totalElements` integer — Total number of elements in all available pages
  - `hasNext` boolean — 'false' value indicates the end of the result set

---

[API](https://skmtc.net/thingsboard/apis/thingsboard-rest-api.md) · [All operations](https://skmtc.net/thingsboard/apis/thingsboard-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/thingsboard/thingsboard-rest-api/revisions/40169ccdec5c/schema)
