none
Record.FromList - undocumented/wrong how to use it? RRS feed

  • Question

  • On page 44 of power query language specification power query language it is mentioned that one can also contruct a record from a list

    however when I try this

    let
        s={[Name="a",Value=1],[Name="b",Value=2]} ,
        b=Record.FromList(s)
    in
        b

    I get 

    Expression.Error: 1 arguments were passed to a function which expects 2.
    Details:
        Pattern=
        Arguments=List

    and I can't find a mention of this in the function categories list

    BTW my overall goal is to convert from a column  "keywords" with entries consisting of a single string representing a dictionary (eg 

    "gender:m,age:36"  ) into a column of records ( and then expand column)

    nb each row may have different keywords 


    • Edited by seanvio Friday, May 2, 2014 10:25 PM
    Friday, May 2, 2014 4:21 PM

Answers

  • Looks like we need to update the language specification and formula reference. Thanks for catching this!

    In the Editor you can see what a library function should take by typing out the function name. For example, if you entered:

    = Record.FromList

    It will display the list of parameters it expects as well as some examples.  For Record.FromList, the first parameter is a list of values and the second parameter is a list of names. For the example above, it would be:

    = Record.FromList({1, 2}, {"a", "b"})
    -Alejandro

    • Marked as answer by seanvio Friday, May 2, 2014 10:26 PM
    Friday, May 2, 2014 9:29 PM