Skip to content
SumOfficeSumOfficeSumOffice

Power Query: tables from queries

Loading a query's result onto a sheet, refreshing such tables, and the link between a table on a sheet and the query that fills it. Operations on this page: 8.

Loading a query’s result onto a sheet, refreshing such tables, and the link between a table on a sheet and the query that fills it. Terms are in the glossary.

Lists the queries bound to a sheet or table.

Request

Field TypeScript type Req.
operation "pq-product-ribbon-list" yes

Response on success · pq-product-ribbon-list

Field TypeScript type Req.
operation "pq-product-ribbon-list" yes
queries PqProductRibbonQueryPayload[] yes

Minimal JSON template

{
"operation": "pq-product-ribbon-list",
"requestedBackend": "native-desktop"
}

Checks whether the named sheet, table, or range has a query.

Request

Field TypeScript type Req.
operation "pq-product-ribbon-probe" yes
sheet_name string yes
table_name string no
range_ref string no

Response on success · pq-product-ribbon-probe

Field TypeScript type Req.
operation "pq-product-ribbon-probe" yes
query PqProductRibbonQueryPayload no
denied PqProductRibbonDenied no

Minimal JSON template

{
"operation": "pq-product-ribbon-probe",
"sheet_name": "<string>",
"requestedBackend": "native-desktop"
}

Unbinds a query from a sheet or table.

Request

Field TypeScript type Req.
operation "pq-product-ribbon-remove" yes
query_id string yes

Response on success · pq-product-ribbon-remove

Field TypeScript type Req.
operation "pq-product-ribbon-remove" yes
removed boolean yes

Minimal JSON template

{
"operation": "pq-product-ribbon-remove",
"query_id": "<string>",
"requestedBackend": "native-desktop"
}

Loads a query’s result onto a sheet: where to place it, with or without a header.

Request

Field TypeScript type Req.
operation "product_table_range_load_to" yes
subsetId string yes
identity TableRangeSourceIdentity yes
mText string yes
queryStableId string no
displayName string no
destination TableRangeOutputPlacement yes
anchor CellAnchor no
includeHeader boolean yes
requestedBackend ComputeBackendKind | null no

Response on success · product_table_range_load_to

Field TypeScript type Req.
operation "product_table_range_load_to" yes

Minimal JSON template

{
"operation": "product_table_range_load_to",
"subsetId": "<subsetId>",
"identity": "<TableRangeSourceIdentity>",
"mText": "<string>",
"destination": "<TableRangeOutputPlacement>",
"includeHeader": false,
"requestedBackend": "native-desktop"
}

Edits the query step behind a range.

Request

Field TypeScript type Req.
operation "product_table_range_mutate_step" yes
subsetId string yes
identity TableRangeSourceIdentity yes
mText string yes
queryStableId string no
mutation StepMutation yes
editorSessionId string no
generation number no
requestedBackend ComputeBackendKind | null no

Response on success · product_table_range_mutate_step

Field TypeScript type Req.
operation "product_table_range_mutate_step" yes
result TableRangeQueryMutationPreview yes
session EditorSessionStamp no

Minimal JSON template

{
"operation": "product_table_range_mutate_step",
"subsetId": "<subsetId>",
"identity": "<TableRangeSourceIdentity>",
"mText": "<string>",
"mutation": "<StepMutation>",
"requestedBackend": "native-desktop"
}

Opens the query that produced this range.

Request

Field TypeScript type Req.
operation "product_table_range_open_query" yes
subsetId string yes
identity TableRangeSourceIdentity yes
queryStableId string no
requestedBackend ComputeBackendKind | null no

Response on success · product_table_range_open_query

Field TypeScript type Req.
operation "product_table_range_open_query" yes
ready boolean yes
projection AppliedStepsProjection no
preview TableRangeQueryPreview no
session EditorSessionStamp no
blockReason string no
blockDetail string no
existingOutputStableId string no

Minimal JSON template

{
"operation": "product_table_range_open_query",
"subsetId": "<subsetId>",
"identity": "<TableRangeSourceIdentity>",
"requestedBackend": "native-desktop"
}

Refreshes every range in the workbook from its query.

Request

Field TypeScript type Req.
operation "product_table_range_refresh_all" yes
subsetId string yes
action "run" | “start” | “poll” | “commit” | “cancel” no
generation number no
requestedBackend ComputeBackendKind | null no

Response on success · product_table_range_refresh_all

Field TypeScript type Req.
operation "product_table_range_refresh_all" yes

Minimal JSON template

{
"operation": "product_table_range_refresh_all",
"subsetId": "<subsetId>",
"requestedBackend": "native-desktop"
}

Refreshes a single range from its query.

Request

Field TypeScript type Req.
operation "product_table_range_refresh_current" yes
subsetId string yes
queryStableId string yes
action "run" | “start” | “poll” | “commit” | “cancel” no
generation number no
requestedBackend ComputeBackendKind | null no

Response on success · product_table_range_refresh_current

Field TypeScript type Req.
operation "product_table_range_refresh_current" yes

Minimal JSON template

{
"operation": "product_table_range_refresh_current",
"subsetId": "<subsetId>",
"queryStableId": "<string>",
"requestedBackend": "native-desktop"
}

Documentation assistant

Answers are assembled from the documentation and may be inaccurate — check the sources.