Skip to main content
Microsoft Idea

Power BI

Needs Votes

Selected Columns list to give expanded fields as well

Vote (1) Share
Paul Cooper's profile image

Paul Cooper on 12 Nov 2019 19:07:38

Currently onSelectedColumns gives only top level fields.

It is common for REST APIs not to return all fields and only return initially hidden fields if specifically asked for. If not asked for then you get "null" in those fields, usually because they are not actually in the response, but the connector has code to enforce the schema.

onSelectedColumns gets passed a list of fields so this can be used to modify the REST call to ask for the selected fields and so the hidden ones can then be populated.

REST calls can return nested structures and the schema can support this. The fields in these nested parts can be access via expanding the fields that are of record type.

Unfortunately the list of fields passed to onSelectedColumns does not include the fields in the nested parts so you cannot use this list to request the REST Call to populate the hidden fields in those parts.

My request is for the expanded fields to also be included in the list of selected columns.

E.g.:

top level fields:

id (number), cost (number), cost_centre (record)

second level fields from Cost Centre:

cost_centre_id (number), cost_centre_code (text), responsible_person_name (text)

If I select id, cost, cost_centre_code and responsible_person_name the list would be:

{ "id", "cost", "cost_centre", "cost_centre.cost_centre_code", "cost_centre.responsible_person_name" }

For backward compatibility reasons there may need to be a mechanism to only add these nested fields if requested to, so existing connectors do not break.