Modify project variables through a hook in advanced govern node

Hi everyone,
I am currently designing a custom blueprint with the blueprint designer on Dataiku Govern.
I am configuring a hook to communicate with a project in the design node and I would like the hook to access and modify the global variables of the design node project (based on variables I have stored in the artifact fields) and then run a scenario.
I managed to run the scenario but I cannot modify the global variables of the project. I don't find the correct function.
the following code : dataikuapi.DSSClient(host, api).get_project('project').get_variables() only returns the variables. It does not modify them.
Could someone tell me how to modifiy these variables ?
Answers
-
Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,501 Neuron
-
Your code is able to get variables in the project scope.
variables = project.get_variables()
In that case, you can modify the variables dict
variables["standard"]["your_variable_name"] = "your_modified_variable_value" variables["standard"]["a_new_variable_name"] = "your_newvariable_value"
and then save the modified and new values
project.set_variables(variables)
You will find more details in the