Scenario with parameters

Highlighted
Alan_Fusté
Level 3
Scenario with parameters
Jump to solution
Hello,

I've found in the documentation that I can execute scenario with parameters (https://doc.dataiku.com/dss/latest/python-api/rest-api-client/scenarios.html) doing something like scenario.run({'x': y}) but is there a way to run a scenario from another scenario sending execution parameters (in my case, a date)?



Thank you
0 Kudos
1 Solution

Accepted Solutions
Mattsco Dataiker
Dataiker
Re: Scenario with parameters
Jump to solution

Hi, 



I would use project variables.



In your case, I would set the variables of project A to {"x":y} and run scenario of project A from project B. 



You can use the python client to do that in a python step of a scenario: 



 



import dataiku



client = dataiku.api_client()



p = client.get_project(PROJECT_A)



variables = p.get_variables()



variables["standard"] = {"x":y}



p.set_variables(variables)



 



Doc about project variables: 



https://doc.dataiku.com/dss/latest/advanced/variables_expansion.html



 

Mattsco

View solution in original post

2 Replies
Mattsco Dataiker
Dataiker
Re: Scenario with parameters
Jump to solution

Hi, 



I would use project variables.



In your case, I would set the variables of project A to {"x":y} and run scenario of project A from project B. 



You can use the python client to do that in a python step of a scenario: 



 



import dataiku



client = dataiku.api_client()



p = client.get_project(PROJECT_A)



variables = p.get_variables()



variables["standard"] = {"x":y}



p.set_variables(variables)



 



Doc about project variables: 



https://doc.dataiku.com/dss/latest/advanced/variables_expansion.html



 

Mattsco

View solution in original post

Alan_Fusté
Level 3
Re: Scenario with parameters
Jump to solution
Ok, I'll try your solution! Thanks Mattsco!
0 Kudos
Labels (2)