Action.View

Updated on

Action.View is a Power Query M function that creates or extends an action with user-defined handlers for query and action operations.

Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365

Syntax

Action.View(
   action as any,
   handlers as record,
) as any

Description

Returns a view of action where the functions specified in handlers are used in lieu of the default behavior of an operation when the operation is applied to the view.

If action is provided, all handler functions are optional. If action isn’t provided, the OnExecute handler function is required. If a handler function isn’t specified for an operation, the default behavior of the operation is applied to action instead (except in the case of GetExpression).

Handler functions must return a value that is semantically equivalent to the result of applying the operation against action (or the resulting view in the case of GetExpression).

If a handler function raises an error, the default behavior of the operation is applied to the view.

Action.View can be used to implement folding to a data source – the translation of M queries into source-specific operations (for example, to insert rows into a table).

Refer to the published Power Query custom connector documentation for a more complete description of Action.View.

Other functions related to Action.View are:

Contribute » | Contributors: Rick de Groot