<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Dataflow Gen2 w/ Variable Library - variable resolves but fails in destination query in Data Engineering</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Dataflow-Gen2-w-Variable-Library-variable-resolves-but-fails-in/m-p/5160260#M16057</link>
    <description>&lt;P&gt;Update - this was the issue. My query that got the variable value used the Variable.Value function - this was the whole script (my variable library name is just called "Env"):&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Variable.Value("$(/**/Env/WorkspaceId)")&lt;/LI-CODE&gt;&lt;DIV&gt;&lt;P&gt;&lt;SPAN&gt;This was returning a table, not a scalar. When I tried to convert the output to lowercase as suggested, this caused an error, which tipped me off that it was returning a table.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My variable query had staging enabled (see below) by default. I read that the Variable.Value function returns a single-column table for staging queries, so I turned off staging and this resolved the issue.&lt;/SPAN&gt;&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="merganzeruncle_0-1777397844256.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1335101iF4067AE76E712CD8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="merganzeruncle_0-1777397844256.png" alt="merganzeruncle_0-1777397844256.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 28 Apr 2026 17:39:05 GMT</pubDate>
    <dc:creator>merganzeruncle</dc:creator>
    <dc:date>2026-04-28T17:39:05Z</dc:date>
    <item>
      <title>Dataflow Gen2 w/ Variable Library - variable resolves but fails in destination query</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Dataflow-Gen2-w-Variable-Library-variable-resolves-but-fails-in/m-p/5158082#M16006</link>
      <description>&lt;P&gt;I'm trying to create a Dataflow Gen2 that uses a variable library to remap the destination lakehouse between stages of a deployment pipeline. I followed these two guides:&lt;/P&gt;&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/fabric/cicd/variable-library/tutorial-variable-library" target="_blank" rel="noopener"&gt;https://learn.microsoft.com/en-us/fabric/cicd/variable-library/tutorial-variable-library&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/fabric/data-factory/dataflow-gen2-variable-library-integration" target="_blank" rel="noopener"&gt;https://learn.microsoft.com/en-us/fabric/data-factory/dataflow-gen2-variable-library-integration&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/fabric/data-factory/dataflow-gen2-variable-library-integration" target="_blank" rel="noopener"&gt;&amp;nbsp;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I have created a variable library with entries for WorkspaceId and a LakehouseId.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two queries for WorkspaceId and LakehouseId in my Dataflow. These appear to be working. Just as a test, I added another query that writes these to a (hardcoded) lakehouse destination, and the data that appears when I run this is correct (the correct Workspace Id and Lakehouse Id).&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/fabric/data-factory/dataflow-gen2-variable-library-integration" target="_blank" rel="noopener"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="merganzeruncle_0-1776207676299.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1333602i50E63AB06C8EC81E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="merganzeruncle_0-1776207676299.png" alt="merganzeruncle_0-1776207676299.png" /&gt;&lt;/span&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/fabric/data-factory/dataflow-gen2-variable-library-integration" target="_blank" rel="noopener"&gt;&amp;nbsp;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;However, when I try to use WorkspaceId and LakehouseId in the destination query of one of my actual data queries, I get an error "The key didn't match any rows in the table".&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/fabric/data-factory/dataflow-gen2-variable-library-integration" target="_blank" rel="noopener"&gt;&amp;nbsp;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Here is the m script for the destination query that fails:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;LI-CODE lang="markup"&gt;let
  Pattern = Lakehouse.Contents([CreateNavigationProperties = false, EnableFolding = false, HierarchicalNavigation = true]),
  Navigation_1 = Pattern{[workspaceId = WorkspaceId]}[Data],
  Navigation_2 = Navigation_1{[lakehouseId = LakehouseId]}[Data],
  Navigation_3 = Navigation_2{[Id = "Strong", ItemKind = "Schema"]}[Data],
  TableNavigation = Navigation_3{[Id = "Destination", ItemKind = "Table"]}[Data]
in
  TableNavigation&amp;lt;p&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(To clarify, that ID="Destination" is because the destination table name is also incidentally called "Destination" for unrelated reasons)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This was generated by using the destination lakehouse widget on the query, but then I replaced the hardcoded workspace Id and lakehouse Id with my variables. Other potentially relevant information - the destination lakehouse is schema-enabled. These queries don't use incremental refresh, although I have another Dataflow that I need to do this in that does use an incremental refresh.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2026 18:38:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Dataflow-Gen2-w-Variable-Library-variable-resolves-but-fails-in/m-p/5158082#M16006</guid>
      <dc:creator>merganzeruncle</dc:creator>
      <dc:date>2026-04-24T18:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: Dataflow Gen2 w/ Variable Library - variable resolves but fails in destination query</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Dataflow-Gen2-w-Variable-Library-variable-resolves-but-fails-in/m-p/5158761#M16018</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1239162"&gt;@merganzeruncle&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is a known gotcha with Variable Library + &lt;STRONG&gt;&lt;EM&gt;Lakehouse.Contents&lt;/EM&gt;&lt;/STRONG&gt; navigation. The error "The key didn't match any rows in the table" almost always means one of two things:&lt;/P&gt;&lt;P&gt;1. GUID case mismatch (most likely)&lt;/P&gt;&lt;P&gt;The navigation table returned by &lt;STRONG&gt;&lt;EM&gt;Lakehouse.Contents&lt;/EM&gt;&lt;/STRONG&gt; uses lowercase GUIDs, but the variable library sometimes stores/returns them in uppercase or mixed case. The comparison is case-sensitive.&lt;/P&gt;&lt;P&gt;Fix wrap your variables with &lt;STRONG&gt;&lt;EM&gt;Text.Lower&lt;/EM&gt;&lt;/STRONG&gt; and &lt;STRONG&gt;&lt;EM&gt;Text.Trim&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;let&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Pattern = Lakehouse.Contents([CreateNavigationProperties = false, EnableFolding = false, HierarchicalNavigation = true]),&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Navigation_1 = Pattern{[workspaceId = Text.Lower(Text.Trim(WorkspaceId))]}[Data],&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Navigation_2 = Navigation_1{[lakehouseId = Text.Lower(Text.Trim(LakehouseId))]}[Data],&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Navigation_3 = Navigation_2{[Id = "Strong", ItemKind = "Schema"]}[Data],&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;TableNavigation = Navigation_3{[Id = "Destination", ItemKind = "Table"]}[Data]&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;in&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;TableNavigation&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Variable returns a table, not a scalar&lt;/P&gt;&lt;P&gt;If your WorkspaceId query returns a single-row table instead of a plain text value, the navigation lookup will also fail. To verify, check that your variable query ends with something like:&lt;BR /&gt;= VariableLibrary{[Name = "WorkspaceId"]}[Value]&lt;/P&gt;&lt;P&gt;...returning a plain text scalar, not a table.&lt;/P&gt;&lt;P&gt;Quick diagnostic: Add a temporary query &lt;STRONG&gt;&lt;EM&gt;= Text.Lower(WorkspaceId)&lt;/EM&gt;&lt;/STRONG&gt; if it errors, your variable is not a scalar yet.&lt;/P&gt;&lt;P&gt;Note: since your lakehouse is schema-enabled, the &lt;STRONG&gt;&lt;EM&gt;{[Id = "Strong", ItemKind = "Schema"]}&lt;/EM&gt;&lt;/STRONG&gt; step looks correct, assuming "Strong" is the schema name. Double-check this matches the actual schema name in your lakehouse.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this unblocks you&lt;/P&gt;</description>
      <pubDate>Sun, 26 Apr 2026 17:57:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Dataflow-Gen2-w-Variable-Library-variable-resolves-but-fails-in/m-p/5158761#M16018</guid>
      <dc:creator>Tamanchu</dc:creator>
      <dc:date>2026-04-26T17:57:26Z</dc:date>
    </item>
    <item>
      <title>Re: Dataflow Gen2 w/ Variable Library - variable resolves but fails in destination query</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Dataflow-Gen2-w-Variable-Library-variable-resolves-but-fails-in/m-p/5160249#M16055</link>
      <description>&lt;P&gt;Thank you! This was very helpful.&lt;/P&gt;&lt;P&gt;I think it is actually the second one - when I try normalizing the LakehouseId and WorkspaceId variables, I get an error that says that the input is a table and not a scalar.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The syntax you suggested: VariableLibrary{[Name = "WorkspaceId"]}[Value] isn't what's in the guides - I'm using this syntax:&lt;BR /&gt;Variable.Value("$(/**/Env/[VariableName])"). How do I refer to my specific Variable Library using the syntax you have written? It doesn't work to replace "VariableLibrary" with my library name - how do I specify the library name?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2026 17:26:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Dataflow-Gen2-w-Variable-Library-variable-resolves-but-fails-in/m-p/5160249#M16055</guid>
      <dc:creator>merganzeruncle</dc:creator>
      <dc:date>2026-04-28T17:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: Dataflow Gen2 w/ Variable Library - variable resolves but fails in destination query</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Dataflow-Gen2-w-Variable-Library-variable-resolves-but-fails-in/m-p/5160260#M16057</link>
      <description>&lt;P&gt;Update - this was the issue. My query that got the variable value used the Variable.Value function - this was the whole script (my variable library name is just called "Env"):&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Variable.Value("$(/**/Env/WorkspaceId)")&lt;/LI-CODE&gt;&lt;DIV&gt;&lt;P&gt;&lt;SPAN&gt;This was returning a table, not a scalar. When I tried to convert the output to lowercase as suggested, this caused an error, which tipped me off that it was returning a table.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My variable query had staging enabled (see below) by default. I read that the Variable.Value function returns a single-column table for staging queries, so I turned off staging and this resolved the issue.&lt;/SPAN&gt;&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="merganzeruncle_0-1777397844256.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1335101iF4067AE76E712CD8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="merganzeruncle_0-1777397844256.png" alt="merganzeruncle_0-1777397844256.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 28 Apr 2026 17:39:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Dataflow-Gen2-w-Variable-Library-variable-resolves-but-fails-in/m-p/5160260#M16057</guid>
      <dc:creator>merganzeruncle</dc:creator>
      <dc:date>2026-04-28T17:39:05Z</dc:date>
    </item>
  </channel>
</rss>

