title: Dynamically referring to JSON node in Power Query M
body: <p>I have a function that extracts a node from JSON document as follows:</p>
  <pre><code>...
  Json  = GetJson(Url),
  Value = Json[#&quot;values&quot;]
  </code></pre>
  <p>values correspond to the actual node within the JSON document.</p>
  <p>I would like to generalize this piece of code and provide the name of the node as a variable like:</p>
  <pre><code>let myFunc = (parentNodeName as text) =&gt;
  ...
  Json  = GetJson(Url),
  Value = Json[parentNodeName]
  </code></pre>
  <p>However getting this error:
  <code>An error occurred in the ‘myFunc’ query. Expression.Error: The field 'parentNodeName' of the record wasn't found.</code></p>
  <p>How can I refer to the JSON node dynamically?</p>