Forum Discussion

NBEN66's avatar
NBEN66
Frequent Visitor
3 years ago
Solved

Dynamically import custom functions

Hello Everyone,    At our company we are trying to automate customer orders that are sent in via PDF. We have hundreds of customer with different PDF templates. We decided to use Power query PDF im...
  • jennratten's avatar
    3 years ago

    Hello - yes, this can be done.  Here is an example:

    let
        //Load M code from text file
        Source = Text.FromBinary(File.Contents("C:\PathToYourFile.txt")),
        //Evaluate the code from the file as an M expression
        EvaluatedExpression = Expression.Evaluate(Source, #shared)    
    in
        EvaluatedExpression