Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
cviciano7707
Regular Visitor

Fabric Gen2 Dataflow: Variable.ValueOrDefault Not Retrieving Active Value from Variable Library

Hi everyone,

 

I have created a Variable Library named Test, which contains a variable called TestVar. In my Gen2 Dataflow, I'm referencing this variable using the Variable.ValueOrDefault("$(/**/Test/TestVar)", "filename_Default.xlsx") function.

 

The dataflow runs successfully without any errors, but it doesn't seem to retrieve the active value set in the Variable Library. Instead, it is retrieving the default value used in the function.

 

Both the Gen2 Dataflow (CI/CD) and the Variable Library are located in the same workspace, and to avoid any mismatches, I’ve created them in the root folder. The Gen2 Dataflow reads a table from a Lakehouse in another workspace and writes the data to a Warehouse table in the same workspace as the dataflow.

I'm using ticket https://community.fabric.microsoft.com/t5/Fabric-platform/Fabric-Gen2-Dataflow-Variable-Value-not-wo... as a reference and have already reviewed all the points listed in it.

 

Has anyone run into this issue before? Is there a specific configuration or step I'm missing to ensure the dataflow picks up the active value from the library?

 

Screenshots are attached for reference.

 

Variable Library:

cviciano7707_0-1759764045310.png

 

Gen2 Dataflow (CI/CD):

cviciano7707_1-1759764083245.png

cviciano7707_3-1759764110625.png

 

Datafalow refresh:

cviciano7707_4-1759764128062.png

 

 

Table data (loaded by dataflow):

cviciano7707_5-1759764145515.png

 

Thanks in advance for help!

1 ACCEPTED SOLUTION
MJParikh
Resolver II
Resolver II

Hi @cviciano7707,

I hit this before. Your dataflow is resolving the variable, but it is running with the library’s Default value set. That is why you always see Filename_Default.xlsx.

Key points

  1. On-demand runs in the workspace use the library’s Default value set.

  2. Dataflow Gen2 picks an alternative value set only when you bind or override it at run time.

  3. Variable.ValueOrDefault falls back to the second argument if the library or value set is not bound for that run.

What to do
A. Quick proof

  • In Variable Library, switch the Default value set to QA.

  • Run the dataflow on-demand.

  • You should now see the QA file name. Switch back after testing.

B. Proper runtime binding

  • Trigger the dataflow from a Pipeline.

  • In the Dataflow Gen2 activity, open Runtime settings, select Variable library, choose the value set, then run.

  • Email alerts or Teams actions are optional.

C. Deployment pipelines

  • Use deployment rules to map the target stage to the desired value set, so Dev uses Default, QA uses QA, Prod uses Prod.

D. Authoring hygiene

  • In the dataflow, add a test step:

     
    = Variable.Value("$(/**/Test/TestVar)")

    Confirm the preview matches the chosen value set after a pipeline-triggered run.

  • Keep the library and the dataflow in the same workspace.

  • Avoid duplicate library names across workspaces. If duplicates exist, use a fully qualified path tied to the workspace ID.

Common pitfalls

  • Expecting on-demand runs to follow QA or Prod. They follow Default.

  • Forgetting to set the value set on the Pipeline activity.

  • Caching during authoring. Use Refresh preview after changing the value set.

  • Missing library permissions for the runtime identity.

View solution in original post

2 REPLIES 2
MJParikh
Resolver II
Resolver II

Hi @cviciano7707,

I hit this before. Your dataflow is resolving the variable, but it is running with the library’s Default value set. That is why you always see Filename_Default.xlsx.

Key points

  1. On-demand runs in the workspace use the library’s Default value set.

  2. Dataflow Gen2 picks an alternative value set only when you bind or override it at run time.

  3. Variable.ValueOrDefault falls back to the second argument if the library or value set is not bound for that run.

What to do
A. Quick proof

  • In Variable Library, switch the Default value set to QA.

  • Run the dataflow on-demand.

  • You should now see the QA file name. Switch back after testing.

B. Proper runtime binding

  • Trigger the dataflow from a Pipeline.

  • In the Dataflow Gen2 activity, open Runtime settings, select Variable library, choose the value set, then run.

  • Email alerts or Teams actions are optional.

C. Deployment pipelines

  • Use deployment rules to map the target stage to the desired value set, so Dev uses Default, QA uses QA, Prod uses Prod.

D. Authoring hygiene

  • In the dataflow, add a test step:

     
    = Variable.Value("$(/**/Test/TestVar)")

    Confirm the preview matches the chosen value set after a pipeline-triggered run.

  • Keep the library and the dataflow in the same workspace.

  • Avoid duplicate library names across workspaces. If duplicates exist, use a fully qualified path tied to the workspace ID.

Common pitfalls

  • Expecting on-demand runs to follow QA or Prod. They follow Default.

  • Forgetting to set the value set on the Pipeline activity.

  • Caching during authoring. Use Refresh preview after changing the value set.

  • Missing library permissions for the runtime identity.

Hi @MJParikh ,

 

Thanks for replying.

I followed the three steps you described under Quick proof, and it worked — everything is functioning properly now.

 

I really appreciate your help.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Fabric Update Carousel

Fabric Monthly Update - October 2025

Check out the October 2025 Fabric update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.