Skip to main content
100%

[Power Query] Replace an unary function type with a custom type that contains metadata for allowed parameter values

✓ Published0🌍 Public
HHugoberry
Last edited Oct 13, 2017
Created on Oct 12, 2017

This example demonstrates how to replace an unary function type with a custom type that carries metadata for allowed parameter values. The code defines a function `setParameters` that accepts a function `f` and a list `allowedValues`, then constructs a new parameter type using `Value.Type` and attaches documentation metadata via `meta`. It builds a function type with `type function` and applies it using `Value.ReplaceType` to modify the original function’s type. The implementation relies on Power Query’s `Value.Type` and `Value.ReplaceType` APIs, with metadata defined by `Documentation.AllowedValues` for parameter validation.

AI-generated description

Similar vizzes