ItemExpression.From

This function retrieves the abstract syntax tree (AST) for the body of a function, which is then normalized into an item expression. The function must be a lambda with only one argument. All mentions ...

Syntax

ItemExpression.From(function as function) as record

About

This function retrieves the abstract syntax tree (AST) for the body of a function, which is then normalized into an item expression. The function must be a lambda with only one argument. All mentions of the function parameter are substituted with ItemExpression.Item. The resulting AST will be simplified to include only the following node types: Constant, Invocation, Unary, Binary, If, Field Access. An error will be generated if an item expression AST cannot be produced for the function's body. This function is equivalent to RowExpression.From.

Explanation

The AST for the function body is returned when each _ is not equal to null. This can be achieved using Power Query MItemExpression.From(each _ <> null). The output obtained from this operation will have the following structure: - Kind: "Binary" - Operator: "NotEquals" - Left: ItemExpression.Item - Right: - Kind: "Constant" - Value: null