☝️Small business or a startup? See if you qualify for our special offer.
+
All documentation

/fields request

[starting from version: 2.8]

A request for all fields with their types.

Request

{
type: string,
index: string
}
Property/TypeDescription
type
String
The type of the request. In this case, it is "fields".
index
String
The dataset identifier.

Response

{
  fields: FieldInfoObject[],
  aggregations: string[] | {
   any: string[],
   date: string[],
   number: string[],
   string: string[]
  },
  filters: boolean | {
    any: boolean | FilterConfigObject,
    date: boolean | FilterConfigObject,
    number: boolean | FilterConfigObject,
    string: boolean | FilterConfigObject,
advanced: boolean
  },
  sorted: boolean
}
Property/TypeDescription
fields
FieldInfoObject[]
Contains information about fields in the dataset.
aggregations
String[] | Object
optional Aggregation functions supported on the server. They can be defined:
  • For all fields — in this case, specify aggregations as an array of strings.
  • For fields of a certain type — in this case, specify aggregations as an object.
The server may support the following aggregations: "sum", "count", "distinctcount", "average", "median", "product", "min", "max", "stdevp", "stdevs", "none", or a custom aggregation. Note: for fields of the "number" type, Flexmonster Pivot provides built-in front-end aggregations.

To override supported aggregations for a specific field, use the field's aggregations property.

Learn more about supporting aggregation functions.
aggregations.any
String[]
optional Supported aggregation functions for fields of any type.
aggregations.date
String[]
optional Supported aggregation functions for fields of the "date" type. These aggregations override aggregations from the any property.
aggregations.number
String[]
optional Supported aggregation functions for fields of the "number" type. These aggregations override aggregations from the any property.
Note: for fields of this type, Flexmonster Pivot provides built-in front-end aggregations.
aggregations.string
String[]
optional Supported aggregation functions for fields of the "string" type. These aggregations override aggregations from the any property.
filters
Boolean | Object
optional Filters supported on the server.
If the server supports all filters available in Flexmonster Pivot, set filters to true. To support only some filters or configure filters for fields of a certain type, specify filters as an object.

To override supported filters for a specific field, use the field's filters property.

Learn more about configuring filters.
filters.any
Boolean | FilterConfigObject
optional Supported filters for fields of any type.
filters.date
Boolean | FilterConfigObject
optional Supported filters for fields of the "date" type. These filters override filters from the any property.
filters.number
Boolean | FilterConfigObject
optional Supported filters for fields of the "number" type. These filters override filters from the any property.
filters.string
Boolean | FilterConfigObject
optional Supported filters for fields of the "string" type. These filters override filters from the any property.
filters.advanced
Boolean
optional Indicates whether the server has advanced hierarchical filters implemented.
When the advanced parameter is set to true, it means that the server supports hierarchies and can filter them, so multilevel hierarchies can be configured in the component.
When advanced is false, the server cannot filter the hierarchical data. In this case, if multilevel hierarchies are configured in the MappingObject, these configurations will be ignored.
Default value: false.
sorted
Boolean
optional If true, the fields’ order from the response will be used to display fields in the Field List.

Example

Request:

{
  "type": "fields",
  "index": "fm-product-sales"
}

Response:

{
  "fields": [
    {
      "uniqueName": "Category",
      "type": "string"
    },
    {
      "uniqueName": "Country",
      "type": "string"
    },
    {
      "uniqueName": "Price",
      "type": "number"
    },
    {
      "uniqueName": "Quantity",
      "type": "number"
    },
  ],
  "aggregations": {
    "any": ["count", "distinctcount"],
    "date": ["count", "distinctcount", "min", "max"],
    "number": ["sum", "average", "count", "distinctcount", "min", "max"]
  },
  "filters": {
    "date": {
      "members": true,
      "query": ["equal", "not_equal", "between", "not_between"],
      "valueQuery": ["greater", "greater_equal", "less", "less_equal"]
    },
    "number": {
      "members": true,
      "query": ["equal", "not_equal", "between", "not_between"],
      "valueQuery": ["top", "bottom"]
    },
    "string": {
      "members": true,
      "query": ["contain", "not_contain"],
      "valueQuery": ["top", "bottom"]
    },
    "advanced": true
  },
  "sorted": false
}

See also

/handshake request
/members request
/select request for pivot table
/select request for flat table
/select request for drill-through view