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! Request now

Reply
Ismail_ZA
Regular Visitor

Fabric Gen2 Dataflow Variable.Value not working when referencing the Variable Library. ErrorCode =

Greetings, 

 

I setup my Variable Library ...

Ismail_ZA_2-1758550910786.png

Workspace folder location ..

Ismail_ZA_3-1758550968823.png

 

 

I created  a Gen2 Dataflow (CI/CD) enabled to test ...

Ismail_ZA_0-1758550382073.png

But I cannot reference the variable in my Dataflow!?!  

Ismail_ZA_4-1758551061451.png

I've checked and rechecked everything that CoPilot said I should check ... and still nothing, maybe the I in AI was overstated, so I proceeded to removing underscores from the variable names moved Dataflow and Variable Library into the root of the Workspace, still nothing.

 

Please, anyone with advice on what I'm missing here?

 

1 ACCEPTED SOLUTION
AntoineW
Solution Sage
Solution Sage

Hello @Ismail_ZA,

 

What’s happening

  • In Dataflow Gen2 (CI/CD) the editor doesn’t actually resolve Variable Library values. If you call Variable.Value("$(/**/…)" ) in the editor, you’ll get “variable … could not be found (ErrorCode 10418)” even when the variable exists. Resolution happens at run time.

Do this instead

  1. Use a fallback in authoring
    Replace your call with:

     
    Variable.ValueOrDefault("$(/**/Data Management/Environment/Workspace_Variables/v_WorkspaceID)", "DEV-LOCAL-FALLBACK")

    – This lets the query evaluate in the editor using the fallback; at refresh/run time the Variable Library value is injected and the fallback is ignored.

  2. Confirm the exact path & names

    • The syntax must be: $(/**/<Folder>/<LibraryName>/<VariableName>)

    • Names are exact (spaces/case matter). Avoid trailing spaces or hidden characters.

    • Try a simpler path (e.g., move the library to the workspace root) and rename to something plain like EnvVars ➜ v_WorkspaceID, then test:

       
      Variable.ValueOrDefault("$(/**/EnvVars/v_WorkspaceID)", "DEV-LOCAL-FALLBACK")
  3. Same workspace + CI/CD enabled

    • The Variable Library and the Dataflow Gen2 (CI/CD) must be in the same workspace.

    • Ensure the dataflow is CI/CD-enabled (that SKU/flag enables variable resolution at runtime).

  4. Run with an active value set

    • If you’re using value sets (DEV/UAT/PROD), make sure the intended set is active when you run (via pipeline or dataflow run settings).

  5. Supported types only

    • Variables must be one of: Boolean, DateTime, Guid, Integer, Number, String. (Strings are safest for IDs/paths.)

  6. Preview + rollout note

    • This feature shipped last week at FabCon and is still in Preview. It may not be fully rolled out in every region/capacity yet. If everything above looks right and it still fails at run time (not just in the editor), it could be a rollout gap—try again later or test in a different capacity/region if you have one.

Quick checklist

  • Use ValueOrDefault(...) during authoring

  • Verify exact path $(/**/Library/Variable)

  • Library + Dataflow in the same workspace

  • Dataflow is CI/CD-enabled

  • Run with the correct value set

  • Variable type is supported

 

Doc : https://learn.microsoft.com/fr-fr/fabric/data-factory/dataflow-gen2-variable-library-integration

 

Hope it can help you ! 

Best regards,

Antoine

View solution in original post

3 REPLIES 3
Nathan_Mosher
Advocate I
Advocate I

Mine also does not work, and I copied/pasted the format from the documentation. This is a new feature in preview, it is possible that it just hasn't released yet to all regions?

formula used: Variable.Value("$(/**/VariableLibraryTest/test)")

Nathan_Mosher_0-1758555556049.pngNathan_Mosher_1-1758555614468.png

 

AntoineW
Solution Sage
Solution Sage

Hello @Ismail_ZA,

 

What’s happening

  • In Dataflow Gen2 (CI/CD) the editor doesn’t actually resolve Variable Library values. If you call Variable.Value("$(/**/…)" ) in the editor, you’ll get “variable … could not be found (ErrorCode 10418)” even when the variable exists. Resolution happens at run time.

Do this instead

  1. Use a fallback in authoring
    Replace your call with:

     
    Variable.ValueOrDefault("$(/**/Data Management/Environment/Workspace_Variables/v_WorkspaceID)", "DEV-LOCAL-FALLBACK")

    – This lets the query evaluate in the editor using the fallback; at refresh/run time the Variable Library value is injected and the fallback is ignored.

  2. Confirm the exact path & names

    • The syntax must be: $(/**/<Folder>/<LibraryName>/<VariableName>)

    • Names are exact (spaces/case matter). Avoid trailing spaces or hidden characters.

    • Try a simpler path (e.g., move the library to the workspace root) and rename to something plain like EnvVars ➜ v_WorkspaceID, then test:

       
      Variable.ValueOrDefault("$(/**/EnvVars/v_WorkspaceID)", "DEV-LOCAL-FALLBACK")
  3. Same workspace + CI/CD enabled

    • The Variable Library and the Dataflow Gen2 (CI/CD) must be in the same workspace.

    • Ensure the dataflow is CI/CD-enabled (that SKU/flag enables variable resolution at runtime).

  4. Run with an active value set

    • If you’re using value sets (DEV/UAT/PROD), make sure the intended set is active when you run (via pipeline or dataflow run settings).

  5. Supported types only

    • Variables must be one of: Boolean, DateTime, Guid, Integer, Number, String. (Strings are safest for IDs/paths.)

  6. Preview + rollout note

    • This feature shipped last week at FabCon and is still in Preview. It may not be fully rolled out in every region/capacity yet. If everything above looks right and it still fails at run time (not just in the editor), it could be a rollout gap—try again later or test in a different capacity/region if you have one.

Quick checklist

  • Use ValueOrDefault(...) during authoring

  • Verify exact path $(/**/Library/Variable)

  • Library + Dataflow in the same workspace

  • Dataflow is CI/CD-enabled

  • Run with the correct value set

  • Variable type is supported

 

Doc : https://learn.microsoft.com/fr-fr/fabric/data-factory/dataflow-gen2-variable-library-integration

 

Hope it can help you ! 

Best regards,

Antoine

Thank you Antoine for the detailed explanation.  This solved the problem.

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.