12 thoughts on “Power Query M Primer (Part 20): Metadata

  1. hank

    Hi Ben,
    Thank you so much, it is such a pleasure to dig into M with your insights.
    I wonder if you could please elaborate how you are using your GetPage function and its metadata to build the full table

    Reply
  2. Dwaine Wright

    Ben,

    I haven’t finished all 20 post yet, but this series is by far the best written, inciteful, and masterfully crafted blog entries I have discovered on this not-so-straight-forward subject. Cheers to you!

    Dwaine

    Reply
  3. Nicolas

    Hi Ben,

    thanks for this series, it has been very insightful and very helpful for me trying to understand “how Power Query thinks” 🙂

    Currently, I’m trying to “hack” the partially lazy way of PQ.
    Can you tell how metadata is evaluated ? Is it lazy or eager ?

    If a metadata of a variable is never used, is it still being evaluated ?

    Thanks for your help.

    Reply
      1. Nicolas

        For example in this code, does the CallFunction() get called, even if the metadata [ts] of A is never accessed ?

        let
            CallFunction = (x) => x + 3,
            A = "somevalue" meta [ ts = CallFunction(5) ]
        in
            A
        Reply
        1. Ben Gribaudo Post author

          Thanks for the example. I don’t believe so. Record field expressions are evaluated lazily, so ts‘s value shouldn’t be computed unless something needs that value.

          Reply
  4. Jon

    Great Explanation about using metadata within powerquery

    A quick question. Do you know to access the metadata records of a function (either the built-ins or custom ones)?
    I am not sure how the syntax needs to be within the parenthesis of the Value.Metadata() so the it recognizes the input as a function

    Thanks

    Reply
    1. Ben Gribaudo Post author

      Hi Jon,

      I’m guessing you’re trying to get a function’s documentation metadata, which is stored as metadata on the function’s type, not directly as metadata on the function value itself.

      Does the below help?

      Value.Metadata(Value.Type(Table.SelectColumns)) // replace "Table.SelectColumns" with whichever function is of interest
      
      Reply
      1. Jon

        Thanks Ben for your reply.

        Correct by metadata records I refer to the metadata that contains all the function’s documentation available like the records [Documentation.Name] [Documentation.Description] etc.

        Yes your solution works like a charm. Thanks for the help

        Cheers

        Reply

Leave a Reply

Your email address will not be published. Required fields are marked *