Get Free Trial
API reference
Table of contents

getColumns

getColumns(): Array

[starting from version: 1.4]

Returns a list of hierarchies selected in the report slice for columns. Note that getColumns has an async equivalent – getColumnsAsync.

Returns

Array of objects. Each object in the array contains the following properties:

  • caption – String. Hierarchy caption.
  • uniqueName – String. Unique hierarchy name.
  • sort – String. Sorting type ("asc", "desc", or "unsorted").
  • type – String. The hierarchy’s type. It is returned for "json", "csv", "api", and "elasticsearch" data source types:
    • For "json" and "csv", the type can be the following: "string", "number", "date", "date string", "year/month/day", "year/quarter/month/day", "datetime", "time".
    • For "api", the type can be the following: "string", "number", "date string", "datetime", "time".
    • For "elasticsearch", the type’s possible values are described here: Field data types.

If data load is in progress an empty array is returned.

Example

flexmonster.getColumns();

/* method returns array of objects
[
	{caption: "Business Type", uniqueName: "Business Type", sort: "desc", type: "string"},
	{caption: "Category", uniqueName: "Category", sort: "asc", type: "string"}
]
*/

Check out on JSFiddle.

See also

getColumnsAsync
getAllHierarchies
getRows
getReportFilters
getAllMeasures
getMeasures