none
How can I use input from a TextBox in a PowerQuery Formula? RRS feed

  • Question

  • I would like to use a PowerQuery Formula which includes input from a text box like

    Json.Document(Web.Contents("https://thesite.com/api/widgets",
                  [Query=[name=TextBoxName.Text]]))

    But I get this error

    Expression.Error: The import TextBoxName.Text matches no exports. Did
     you miss a module reference?

    How do I use TextBoxName.Text as a parameter in my query?


    • Edited by mcnowak Tuesday, December 1, 2015 6:41 PM
    Tuesday, December 1, 2015 6:41 PM

Answers

  • Hi mcnowak. If you want to allow users to update a value and then pass it as a query parameter, you can try the following:

    • Put the value in a cell in Excel
    • Make that cell a named range
    • Use PQ's "From Table" to bring that cell value into the Query world
    • In your formula above, reference the user-entered value using something like TheNamedRangeQueryName[Column1]{0}

    Ehren

    Wednesday, December 2, 2015 12:31 AM
    Owner