Forum Discussion
Referencing notebook exit value as a variable in a data pipeline
- 2 years ago
For my own implementation the delimited string just wasnt flexible enough - so here's a version using a JSON object as the notebook return value:
Notebook pyspark:
lResult={"numUpdated":10,"message":"success","fruit":["apple","orange","grapes"]} mssparkutils.notebook.exit(str(lResult))Expression for varMessageStr:
Anonymous(activity('Test Notebook').output.result.exitValue).messageExpression for varNumUpdatedInt:
INT(json(activity('Test Notebook').output.result.exitValue).numUpdated)Expression for varFruitArray:
Anonymous(activity('Test Notebook').output.result.exitValue).fruit
An update: I found out that changing Set variable activity to:
@activity('Notebook_name').output.result.exitValue... solves the main problem.
I still haven't figured out how to pass multiple notebook values to pipeline variables, so if anyone could help me I will be grateful.
Hi Ostrzak
We can pass multiple parameters from Notebook to a pipeline using list of parameters. I have attached the screenshots along with the steps for your reference.
1) Create a list of parameters inside a notebook.
2) Using notebook and set variable activites we can pass the parameters to a pipeline.
I hope this information is helpful. Please do let us know if you have any questions.