Forum Discussion
CI/CD dataflow issue
Hello tayloramy
thanks for your answer.
For the mashup.pq
i edited my dev file
saved it
git add
git commit
git push
then i verified my code
that is the same in both environments
[StagingDefinition = [Kind = "FastCopy"]]
section Section1;
[DataDestinations = {[Definition = [Kind = "Reference", QueryName = "moeny Numérique_DataDestination", IsNewTarget = false], Settings = [Kind = "Manual", AllowCreation = false, ColumnSettings = [Mappings = {[SourceColumnName = "Année Budgétaire", DestinationColumnName = "Année Budgétaire"], [SourceColumnName = "Ligne Budgétaire", DestinationColumnName = "Ligne Budgétaire"], [SourceColumnName = "Commentaires", DestinationColumnName = "Commentaires"], [SourceColumnName = "Budget Initial", DestinationColumnName = "Budget Initial"], [SourceColumnName = "ID", DestinationColumnName = "ID"], [SourceColumnName = "Modifié", DestinationColumnName = "Modifié"], [SourceColumnName = "Budget_Quasi_ID", DestinationColumnName = "Budget_Quasi_ID"]}], DynamicSchema = false, UpdateMethod = [Kind = "Replace"], TypeSettings = [Kind = "Table"]]]}]
shared #"Budget Direction Numérique" = let
Source = SharePoint.Tables("https://url.com/sites/DptNumrique-bibli", [Implementation = "2.0", ViewMode = "All"]),
#"Navigation 1" = Source{[Id = "d8705c22-aa38-484b-b16e-6bb0035814d4"]}[Items],
#"Colonnes supprimées" = Table.RemoveColumns(#"Navigation 1", {"Title", "Balise de couleur", "ID de ressource de conformité", "Direction", "Modifié par", "Créé", "Type de contenu", "Créé par", "Version", "Pièces jointes", "Modifier", "Type", "Nombre d'éléments enfants", "Nombre d’enfants du dossier", "Paramètres de l’étiquette", "Étiquette de rétention", "Étiquette de rétention appliquée", "Étiquette appliquée par", "L’élément est un enregistrement", "Application créée par", "Application modifiée par"}),
#"Colonne personnalisée ajoutée" = Table.AddColumn(#"Colonnes supprimées", "Budget_Quasi_ID", each [Année Budgétaire] & " - " & [Ligne Budgétaire]),
#"Type de colonne changé" = Table.TransformColumnTypes(#"Colonne personnalisée ajoutée", {{"Budget_Quasi_ID", type text}, {"Budget Initial", type number}}),
#"Valeur remplacée" = Table.ReplaceValue(#"Type de colonne changé", null, 0, Replacer.ReplaceValue, {"Budget Initial"})
in
#"Valeur remplacée";
shared #"moeny Numérique_DataDestination" = let
Pattern = Fabric.Warehouse([HierarchicalNavigation = null, CreateNavigationProperties = false]),
Navigation_1 = Pattern{[workspaceId = ws_Dirnum_id]}[Data],
Navigation_2 = Navigation_1{[warehouseId = wh_Dirnum_id]}[Data],
TableNavigation = Navigation_2{[Schema = "dbo", Item = "Fact_Budget_DN"]}[Data]
in
TableNavigation;
But it doesn't work unfortunately...
Hi GeekAlfPro,
THere's no reference to the variable library in that M code.
If you want it to pull the value from the variable library, you will need to reference the variable library like this:
Variable.ValueOrDefault("$(/**/My Library/My Variable)", "Sample")
Then, after you've done the git commit and git push, you still need to do a git pull in the workspace. You can do that by clicking the update all button in the source control menu of the workspace.
If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.
- GeekAlfPro9 months agoHelper V
i modified my code like this
[...] in #"Valeur remplacée"; shared #"moeny Numérique_DataDestination" = let // 🔧 Lecture des variables de bibliothèque avec valeur par défaut ws_Dirnum_id = Variable.ValueOrDefault("$(/**/My library/ws_Dirnum_id)", "00000000-0000-0000-0000-000000000000"), wh_Dirnum_id = Variable.ValueOrDefault("$(/**/My library/wh_Dirnum_id)", "00000000-0000-0000-0000-000000000000"), // 🧭 Navigation dynamique Fabric (Warehouse cible) Pattern = Fabric.Warehouse([HierarchicalNavigation = null, CreateNavigationProperties = false]), Navigation_1 = Pattern{[workspaceId = ws_Dirnum_id]}[Data], Navigation_2 = Navigation_1{[warehouseId = wh_Dirnum_id]}[Data], TableNavigation = Navigation_2{[Schema = "dbo", Item = "Fact_Budget_DN"]}[Data] in TableNavigation;i've done a pull but without success
- GeekAlfPro9 months agoHelper V
Hi,
i tried the library variables with a pipeline but it doesn't work either !
has anybody managed to set up library variables with a pipeline and dataflow Gen 2 ?
- tayloramy9 months agoSuper User
Hi GeekAlfPro,
inws_Dirnum_id = Variable.ValueOrDefault("$(/**/My library/ws_Dirnum_id)", "00000000-0000-0000-0000-000000000000"),you need to replace My library with the name of your variable library.
I just made a super simplistic test for variable libraries in my enviornment and they work without issue.
Here is my workspace:
in DEV, this is my variable library:
and this is the query in my dataflow:
this results in this record in the lakehouse:
So it properly pulled from the variable library.
Now when I deploy this to PROD with a deployment pipeline:
and I update the prod variable library:
I see the value of the prod variable library in the table in my prod lakehouse:
This is quite simplistic, but shows that variable librarys work without issue.
If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.