locked
error invoking function RRS feed

  • Question

  • I create a function

    let
        GetReportParam = (param as text) =>
    let
        term = ( Table.SelectRows(Excel.CurrentWorkbook(){[Name="Parameters2"]}[Content], each [ParamName] = param) ) {0} [ParamValue]
    in
        term
    in
        GetReportParam

    Test invocation works

    Then I add another Query to use the function

    let
        term = GetReportParam("BingQuery")
    in
        term

    But I get this error

    Unexpected error: The name 'GetReportParam' was not recognized.  Is it spelled correctly?
    Details: Name=GetReportParam, SectionName=Section1, FormulaName=Query3, FormulaPartName=p

    I'm doing this all by experimentation since I cannot find any documentation for creating and using functions in M.

    Friday, November 8, 2013 1:46 AM

Answers

All replies

  • Actually, the test invocation was

    let
        p = GetReportParam("BingQuery")
    in
        p

    Friday, November 8, 2013 1:49 AM
  • I figured it out. I hadn't named the query "GetReportParam"

    Friday, November 8, 2013 2:11 AM