[Bug report] Custom Data Source API + Drillthrough sends calculated fields with select request for flat values

Answered
eze@wejugo.com asked on May 13, 2024

Our backend was reporting an unknown field when we use drillthrough and there are calculated values in the report. 

We have strict checks in our Custom Data Source implementation. Replicating this against Flexmonsters implementation works because it ignores the unknown fields: https://jsfiddle.net/ezk84/y436snk8/3/

Right-clicking a cell and selecting Drillthrough while looking at the Network requests console you'll notice the POST /select has this payload:

{
  "type": "select",
  "index": "fm-product-sales",
  "query": {
    "limit": 1000,
    "filter": {
      "type": "and",
      "value": [
        {
          "field": {
            "uniqueName": "Color"
          },
          "include": [
            {
              "member": "blue"
            }
          ]
        },
        {
          "field": {
            "uniqueName": "Country"
          },
          "include": [
            {
              "member": "Australia"
            }
          ]
        }
      ]
    },
    "fields": [
      {
        "uniqueName": "Color"
      },
      {
        "uniqueName": "Country"
      },
      {
        "uniqueName": "Price"
      },
      {
        "uniqueName": "Quantity"
      },
      {
        "uniqueName": "Min Quantity"
      }
    ]
  },
  "page": 0
}

We've updated our backend to ignore unknown fields in this scenario, but this is possibly a bug in the FM front-end.

2 answers

Public
eze@wejugo.com May 13, 2024

I guess if this isn't a bug, then it's a feature that should be documented in the Data Source API Guide/Documentation.

Public
Maksym Diachenko Maksym Diachenko Flexmonster May 14, 2024

Hello, 

Thank you for writing to us.

The behavior you mentioned regarding calculated measures being sent in the /select request for drill-through was originally intended. This request payload provides information about the measure used within the calculated value ("uniqueName": "Quantity") and a calculated value name itself ("uniqueName": "Min Quantity"). If the calculated value name is not needed, the "Min Quantity" field can be simply ignored.
Given its seemingly unclear purpose, we plan to add this information to our custom API documentation.

Feel free to contact us if further questions arise.

Best Regards,
Maksym 

Please login or Register to Submit Answer