All documentation
  • API Reference for older versions
  • /members request

    [starting from version: 2.8]

    A request for all members of the field.

    Request

    {
     type: string,
      index: string,
     field: FieldObject,
    filter: FilterGroupObject,
      page: number,
    pageToken: string
    }
    Property/TypeDescription
    type
    String
    The type of the request. In this case, it is "members".
    index
    String
    The dataset identifier.
    field
    FieldObject
    The field whose members should be sent in the response.
    filter
    FilterGroupObject
    Filters that should be applied to members. filter is present in the request when multilevel hierarchies are configured in Flexmonster Pivot.
    page
    Number
    Used to load members by pages when their total number can be predicted.
    Indicates which page the server should send in the next response. The page's value starts from 0.
    This property is always present in the initial request and will be included in the next /members requests while the server responses contain the pageTotal and page properties.
    Ignore this property if you don't want to load members by pages.
    pageToken
    String
    Used to load members by pages when their total number cannot be predicted.
    Indicates which page the server should send in the next response. The pageToken's value is equal to the nextPageToken sent in the previous server response.
    This property isn't present in the initial request but will be included in the next /members requests while the server responses contain the nextPageToken property.

    Response

    {
    members: MemberInfoObject[],
    sorted: boolean,
    pageTotal: number,
    page: number,
    nextPageToken: string
    }
    Property/TypeDescription
    members
    MemberInfoObject[]
    Contains the field's members.
    sorted
    Boolean
    optional If true, the members' order from the response will be used as AZ order on the UI.
    pageTotal
    Number
    optional The total number of pages. Used to load members by pages when their total number can be predicted.
    Must be used with the page property. To load the next pages, the component will continue sending the /members requests while the page is less than the pageTotal.
    If the number of pages cannot be predicted — use the nextPageToken property.
    page
    Number
    optional The page number requested by the component in the page property. Used to load members by pages when their total number can be predicted.
    Must be used with the pageTotal property. To load the next pages, the component will continue sending the /members requests while the page is less than the pageTotal.
    If the number of pages cannot be predicted — use the nextPageToken property.
    nextPageToken
    String
    optional Token generated by the server for loading the next page. This token will be sent in the pageToken of the next /members request. Used to load members by pages when their total number cannot be predicted. 
    To load the next pages, the component will continue sending the /members requests while the nextPageToken is present in the response.
    If the number of pages can be predicted — use the pageTotal and page properties.

    Examples

    1. Example with a string field
      Request:
      {
          "index": "dataset-123",
          "type": "members",
          "field": {
             "uniqueName": "city"
          },
          "page": 0
      }
      Response:
      {
          "members": [
              { "value": "Toronto" }, 
              { "value": "Montreal" }, 
              { "value": "New York" }
          ]
      }
    2. Example with a number field
      Request:
      {
          "index": "dataset-123",
          "type": "members",
          "field": {
             "uniqueName": "price"
          },
          "page": 0
      }
      Response:
      {
          "members": [
              { "value": 10 }, 
              { "value": 28 }, 
              { "value": 30 }
          ]
      }
    3. Example with a date field
      Request:
      {
          "index": "dataset-123",
          "type": "members",
          "field": {
             "uniqueName": "order_date"
          },
          "page": 0
      }
      Response:
      {
          "members": [
              { "value": 1562889600000 }, 
              { "value": 1564617600000 }, 
              { "value": 1564963200000 }
          ]
      }
    4. Example with loading members by pages using the pageTotal and page
      Initial request:
      {
          "index": "dataset-123",
          "type": "members",
          "field": {
             "uniqueName": "country"
          },
          "page": 0
      }
      First response:
      {
          "members": [
              { "value": "United States" }, 
              { "value": "Ukraine" }, 
              { "value": "Israel" }
          ],
          "pageTotal": 2,
          "page": 0
      }
      Next request:
      {
          "index": "dataset-123",
          "type": "members",
          "field": {
             "uniqueName": "country"
          },
          "page": 1
      }
      Final response:
      {
          "members": [
              { "value": "United Kingdom" }, 
              { "value": "Germany" }, 
              { "value": "Denmark" }
          ],
          "pageTotal": 2,
          "page": 1
      }
    5. Example with loading members by pages using the nextPageToken
      Initial request:
      {
          "index": "dataset-123",
          "type": "members",
          "field": {
             "uniqueName": "country"
          },
          "page": 0
      }
      First response:
      {
          "members": [
              { "value": "United States" }, 
              { "value": "Ukraine" }, 
              { "value": "Israel" }
          ],
          "nextPageToken": "secondPart"
      }
      Next request:
      {
          "index": "dataset-123",
          "type": "members",
          "field": {
             "uniqueName": "country"
          },
          "pageToken": "secondPart"
      }
      Final response:
      {
          "members": [
              { "value": "United Kingdom" }, 
              { "value": "Germany" }, 
              { "value": "Denmark" }
          ]
      }

    See also

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