Action.View is a Power Query M function that creates or extends an action with user-defined handlers to customize how queries and actions are executed.
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.
Related articles
Learn more about Action.View in the following articles:
- M Mysteries: The Mysterious Type Action—An M-Internal Means to Write Data Modifications to External Systems
In his article “M Mysteries: The Mysterious Type Action,” Ben Gribaudo explores Power Query’s hidden capability to perform data modifications—such as inserts, updates, and deletes—using the undocumented ‘action’ type. Although Power Query is primarily designed for data retrieval and transformation, Gribaudo reveals that it possesses internal functions that can interact with external data sources to modify data. These functions, however, are not intended for general use and require the Power Query SDK for implementation. » Read more
Related functions
Other functions related to Action.View are:
- Action.DoNothing
- Action.Return
- Action.Sequence
- Action.Try
- Action.ViewError
- Action.ViewFunction
- Action.WithErrorContext
2023-2026 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy