Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Hi,
I'm trying to pass a JSON body from an API call to trigger a scenario. The scenario has a step (set global variables) to update global variables, I want to pass the JSON body to the variables field as shown in the screenshot.
Could anyone please help me on this?
Hi @Srini_E ,
Variable expansion is not supported within the "variables" when setting a variable this must be json.
What you can do is use evaluated variables instead by toggling it "on".
1. Using Evaluated variables : โ
2. Using Python step ( example below will read project variable and want to set a global variable)
import dataiku
client = dataiku.api_client()
project = dataiku.api_client().get_project(dataiku.default_project_key())
vars = project.get_variables()
#retrieve the variable
var_to_set = vars['standard']['varname']
global_variables = client.get_variables()
global_variables["varname"] = var_to_set
client.set_variables(global_variables)
Thanks
Hi @Srini_E ,
Variable expansion is not supported within the "variables" when setting a variable this must be json.
What you can do is use evaluated variables instead by toggling it "on".
1. Using Evaluated variables : โ
2. Using Python step ( example below will read project variable and want to set a global variable)
import dataiku
client = dataiku.api_client()
project = dataiku.api_client().get_project(dataiku.default_project_key())
vars = project.get_variables()
#retrieve the variable
var_to_set = vars['standard']['varname']
global_variables = client.get_variables()
global_variables["varname"] = var_to_set
client.set_variables(global_variables)
Thanks