Forum Discussion
Fabric Gen2 Dataflow Variable.Value not working when referencing the Variable Library. ErrorCode =
- 11 months ago
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
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.
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")
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).
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).
Supported types only
Variables must be one of: Boolean, DateTime, Guid, Integer, Number, String. (Strings are safest for IDs/paths.)
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
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)")