[Power Query] Replace an unary function type with a custom type that contains metadata for allowed parameter values
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(f as function, allowedValues as list)=> | |
let | |
//create a new parameter type with metadata for allowed values | |
parameterType = Value.Type(allowedValues{1}) meta [Documentation.AllowedValues = allowedValues], | |
//create a function type with custom parameter type | |
myFunType = type function (select as parameterType) as function | |
in //replace the orginal function type with the new myFunType | |
Value.ReplaceType(f,myFunType) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment